Passage: While studying at the Gelehrtenschule des Johanneums in Hamburg, Hertz showed an aptitude for sciences as well as languages, learning Arabic and Sanskrit. He studied sciences and engineering in the German cities of Dresden, Munich and Berlin, where he studied under Gustav R. Kirchhoff and Hermann von Helmholtz. In 1880, Hertz obtained his PhD from the University of Berlin, and for the next three years remained for post-doctoral study under Helmholtz, serving as his assistant. In 1883, Hertz took a post as a lecturer in theoretical physics at the University of Kiel. In 1885, Hertz became a full professor at the University of Karlsruhe.

Question: What languages did Hertz acquire knowledge of ?
Arabic and Sanskrit