Charged charm production in proton-emulsion interactions at 400 GeV/c