Q: This task involves creating answers to complex questions, from a given passage. Answering these questions, typically involve understanding multiple sentences. Make sure that your answer has the same type as the "answer type" mentioned in input. The provided "answer type" can be of any of the following types: "span", "date", "number". A "span" answer is a continuous phrase taken directly from the passage or question. You can directly copy-paste the text from the passage or the question for span type answers. If you find multiple spans, please add them all as a comma separated list. Please restrict each span to five words. A "number" type answer can include a digit specifying an actual value. For "date" type answers, use DD MM YYYY format e.g. 11 Jan 1992. If full date is not available in the passage you can write partial date such as 1992 or Jan 1992. If you find multiple spans, please add them all as a comma separated list. Please restrict each span to five words.
Passage: Guido Wald Rudiger, count of Starhemberg; was an Austrian military officer. He was a cousin of Ernst Rudiger von Starhemberg , the famous commander of Vienna during the Turkish siege of 1683, and acted as his aide-de-camp during that siege. Guido followed his cousin, and later Prince Eugene of Savoy, in battles against the Turks. In the War of the Spanish Succession, Starhemberg fought in Italy and Spain. Between 1706 and 1708 he was the commander-in-chief of the imperial army in Hungary, leading military operations against the insurgents of Francis II Rakoczi. In 1708, he was appointed Supreme Commander of the Austrians in Spain. Together with James Stanhope he succeeded in conquering Madrid in 1710, after previously gaining victories at Almenar and Saragossa. In December, however, he was forced to leave the city by the lack of support by its inhabitants for the Habsburg pretender. After the subsequent defeats at the Battle of Brihuega and the Battle of Villaviciosa , he had to pull back to Catalonia, where he was made viceroy when Archduke Charles returned to Austria. After the Peace of Utrecht , archduke Charles, now Emperor Charles VI, ordered him to abandon Catalonia. He pulled back with his troops to Genoa on English ships. When he died in 1742, he was Governor of Slavonia.
Question: How many years was Ernst Rudiger von Starhemberg commander-in-chief of the army in Hungary?
Answer type: Number
A:
2.