Given the task definition and input, reply with output. 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: The United States occupation of Nicaragua from 1912 to 1933 was part of the Banana Wars, when the US military forcefully intervened in various Latin American countries from 1898 to 1934. The formal occupation began in 1912, even though there were various other assaults by the U.S. in Nicaragua throughout this period. American military interventions in Nicaragua were designed to stop any other nation except the United States of America from building a Nicaraguan Canal. Nicaragua assumed a quasi-protectorate status under the 1916 Bryan-Chamorro Treaty. But with the onset of the Great Depression and Augusto C. Sandino's Nicaraguan guerrilla troops fighting back against U.S. troops, it became too costly for the U.S. government and a withdrawal was ordered in 1933.
Question: How many years did the US occupy Nicaragua?
Answer type: Number
21.