Charm production in Pb + Pb collisions at energies available at the CERN Large Hadron Collider