the age of five as a cadet in the 1st Regiment of Infantry of Rio de Janeiro. Historian Adriana Barreto de Souza explained that this did "not mean that he began to serve as a child, the connection to the regiment was simply honorific", his perquisite as the son of a military officer. This infantry regiment was informally known as the "Lima [family] Regiment" because so many members of the family served in it, including his father and grandfather. In 1811, Luís Alves moved with his parents from his grandparents' farm to Rio de Janeiro and was enrolled at the Seminário São Joaquim (Saint Joachim School), which became Pedro II School in 1837. On 4 May 1818, he was admitted into the Royal Military Academy. The entire course (which ran from the first to seventh year) was mandatory for artillerymen and engineers but infantrymen were only required to take first- and fifth-year classes. Luís Alves took the first- and fifth-year classes in 1818 and 1819, respectively. Though he could have skipped the other years, he chose to take second-year classes in 1820 and third-year classes in 1821. The subjects he studied in the Royal Military Academy ranged from arithmetic, algebra and geometry to tactics, strategy, camping, fortification in campaign and terrain reconnaissance. He was promoted to alferes (equivalent to a modern-day second lieutenant) on 12 October 1818, and to lieutenant (modern-day first lieutenant) on 4 November 1820. Though an accomplished student, Luís Alves was often reprimanded for bullying new students. With time, he matured, eventually being regarded by his peers as a very reasonable and honest person. He had an ordinary appearance, with a round face, brown hair, brown eyes and average height. Luís Alves's unremarkable features were compensated by his bearing. Historian Thomas Whigham described him as someone who "learned the art of giving orders early in life. Immaculate in his dress, he was soft spoken, polite, and smoothly in control of himself. He seemed to radiate calm composure and authority." Wars and military crises Independence of Brazil Luís Alves would normally have begun the fourth-year classes at the Royal Military Academy in March 1822. Instead, he dropped out in December 1821 and enlisted in the 1st Fusilier Battalion. Prince Dom Pedro, son and heir of King João VI, had just embarked upon the struggle against Portugal that would lead to the independence of Brazil on 7 September 1822.