Following in the footsteps of his father and grandfather, McCain entered the United States Naval Academy, where he was a friend and informal leader for many of his classmates and sometimes stood up for targets of bullying. He also fought as a lightweight boxer. McCain did well in academic subjects that interested him, such as literature and history, but studied only enough to pass subjects that gave him difficulty, such as mathematics. He came into conflict with higher-ranking personnel and did not always obey the rules, which contributed to a low class rank (894 of 899), despite a high IQ. McCain graduated in 1958.