An upper bound for the entropy and its applications to the maximal entropy problem