Built on the west bank of the Rio Cobre, the town lies thirteen miles from Kingston on the main road.  Its history was shaped by two significant colonial periods: Spanish rule from 1534-1655 and the English from 1655-1872. After that the capital was relocated to Kingston. The Anglican Church took over the 16th century cathedral. The historic architecture and street names mark the colonial history, such as Red Church and White Church streets, symbolic of the Spanish chapels of the red and white cross, as well as Monk Street, in reference to the monastery that once stood nearby. Nugent and Manchester streets were named for the British Colonial Governors, George Nugent and William Montagu, 5th Duke of Manchester. King Street runs past the King's House, the governor's residence, and Constitution Street, near to the Square, refers to the island's former administrative centre. Regency buildings in the town centre include the Rodney Memorial and the façade of the Old King's House, which was the residence of the governors until 1872.
Question: How many years was the town a capital under foreign rule?
Answer: 338