Sharp upper bounds on perfect retrieval in the Hopfield model