 His great-grandfather was , a Portuguese nobleman who was a close friend and unofficial advisor to the Empress Maria Theresa.He was the third son of , who was originally devoted to a military career, but resigned to join the landed gentry.From 1834 to 1838, he studied philosophy, then spent a year studying theology at Palacký University in Olomouc.