::This article currently says: "McCain came into conflict with higher-ranking personnel, he did not always obey the rules, and that contributed to a low class rank (894 of 899) that he did not aim to improve.[10][12][13] He did well in academic subjects that interested him, such as literature and history, but studied only enough to pass subjects he disliked, such as math.[5] McCain graduated in 1958.[10]"

Saying "894 of 899" seems okay to me.  Saying instead that he was fifth from the bottom could mean a lot of different things.  For example, if there were six people in his class, it could mean he was ranked number two.

It's important also to keep in mind that "class standing was not solely a function of academic performace" (Timberg, Americam Odyssey, 2007 printing, page 54).  The class rank also reflects the number of demerits, among other tbhings.