Problem: The main legacy of the Revolt of the Barretinas was an enduring anti-French sentiment in the Catalan leadership and intelligentsia.  This would become relevant a decade later in 1700, when King Charles II died without a son.  Charles' death triggered the War of the Spanish Succession.  The two claimants were the French Philip, Duke of Anjou and the Austrian Emperor Leopold I.  The Spanish government chose Philip; French King Louis XIV, Philip's grandfather, naturally supported his grandson as well.  The Catalan upper classes, still distrustful of France from its efforts to stir the peasantry against them in 1689, had no love for Philip.  He was "a king chosen by Castilians."  In 1702, the cortes voted to recognize Leopold as king, and full-scale rebellion against Philip began in 1705 with the arrival of supporting Austrian troops.  The war would continue for nine more years, until the Siege of Barcelona in 1714 when the last remaining Catalan supporters of Leopold were defeated by the combined Franco-Castilian army.  The Nueva Planta decrees, issued by Philip from 1707-1714, ended the nominal split between Castile and Aragon and eliminated the traditional autonomy Aragon had kept.  Castilian law and institutions were mandated throughout Spain.
Answer this question based on the article: What happened first: Charles' death or War of the Spanish Succession?
A: Charles' death

Problem: Håkon Sverresson appeared to have pacified the whole country, but died suddenly in 1204. His successor was the infant Guttorm, who himself died later the same year. The Birkebeiner knew of no other direct descendants of King Sverre and chose one of his nephews, Inge Bårdson, as their new king. By then a revived Bagler party had formed in Denmark, taking another son of King Magnus Erlingsson, Erling Stonewall, as their king. Helped by King Valdemar II of Denmark, they launched an invasion of Norway in 1204, taking control of the Oslofjord-area. This second Bagler war lasted until 1208. When Erling Stonewall fell ill and died in 1207, he was succeeded as Bagler king by Philippus Simonsson, a nephew of King Inge Crouchback and bishop Nikolas of Oslo, and the war continued uninterrupted. The Bagler were strongest in the Oslofjord-area, while Trøndelag was a stronghold of the Birkebeiner, but battles and ambushes took place throughout the country. In the end the bishops were able to negotiate a settlement between the two sides, confirmed at a meeting at Kvitsøy in 1208. The Bagler king Philippus was to remain in control of eastern Norway but renounce the title of king, leaving the Birkebeiner King Inge nominally sole ruler of the country. In the event, Philippus continued to style himself king until his death, but peace between the Bagler and Birkebeiner was preserved until 1217.
Answer this question based on the article: How many years after Sverresson die, did the Bagler war end?
A: 4

Problem: Surprised by such easy gains in the East, the Republic quickly decided to exploit Portugal's weakness in the Americas. In 1621 the Geoctroyeerde Westindische Compagnie  was created to take control of the sugar trade and colonise America . The Company benefited from a large investment in capital, drawing on the enthusiasm of the best financiers and capitalists of the Republic, such as Isaac de Pinto, by origin a Portuguese Jew. The Dutch West India Company would not, however, be as successful as its eastern counterpart. The Dutch invasion began in 1624 with the conquest of the then capital of the State of Brazil, the city of São Salvador da Bahia, but the Dutch conquest was short lived. In 1625, a joint Spanish-Portuguese fleet of 52 ships and 12,000 men rapidly recaptured Salvador. In 1630 the Dutch returned, and captured Olinda and then Recife, renamed Mauritsstadt, thus establishing the colony of New Holland. The Portuguese commander Matias de Albuquerque retreated his forces inland, to establish a camp dubbed Arraial do Bom Jesus. Until 1635, the Dutch were unable to harvest sugar due to Portuguese guerrilla attacks, and were virtually confined to the walled perimeter of the cities. Eventually, the Dutch evicted the Portuguese with the assistance of a local landlord named Domingos Fernandes Calabar, but on his retreat to Bahia, Matias de Albuquerque captured Calabar at Porto Calvo, and had him hang for treason. The Portuguese fought back two Dutch attacks on Bahia in 1638. Nonenetheless, by 1641 the Dutch captured São Luís, leaving them in control of northwestern Brazil between Maranhão and Sergipe in the south
Answer this question based on the article: How many years after the Dutch returned to Brazil did the Portuguese continue to attack and prevent the Dutch from harvesting sugar?
A:
5