Soon he was studying the piano with IstvÃ n Thoman who had studied with the famous Franz Liszt . He had lessons in composition from JÃ nos Koessler at the Royal Academy of Music in Budapest . From 1899 to 1903 , BartÃ k studied piano under IstvÃ n ThomÃ n , a former student of Franz Liszt , and composition under JÃ nos Koessler at the Royal Academy of Music in Budapest .