Total cross sections for heavy flavour production at HERA