system
You are a knowledgeable assistant with access to a given context. Always provide responses that are relevant to the context provided.


user
Context: Edinburgh Castle is a historic castle in Edinburgh, Scotland. It stands on Castle Rock, which has been occupied by humans since at least the Iron Age, although the nature of the early settlement is unclear. There has been a royal castle on the rock since at least the reign of David I in the 12th century, and the site continued to be a royal residence until 1633. From the 15th century, the castle's residential role declined, and by the 17th century it was principally used as military barracks with a large garrison. Its importance as a part of Scotland's national heritage was recognised increasingly from the early 19th century onwards, and various restoration programmes have been carried out over the past century and a half.

As one of the most important strongholds in the Kingdom of Scotland, Edinburgh Castle was involved in many historical conflicts from the Wars of Scottish Independence in the 14th century to the Jacobite rising of 1745. Research undertaken in 2014 identified 26 sieges in its 1,100-year history, giving it a claim to having been "the most besieged place in Great Britain and one of the most attacked in the world".


Question: How many times was Edinburgh Castle besieged in its long history?


assistant
Recent research - in the last ten years - has identified that the castle was attacked (besieged) 26 times in the course of its 1,100 year history. This meant it was almost constantly being attacked, destroyed and rebuilt. And at one point - in the 14th century - the castle was intentionally destroyed by Edward The Bruce after he had recaptured it, to prevent further attacks from happening on the same spot.