Sharp upper bounds for the degree of regularity of the solutions to an elliptic equation