On 22 December the Pretender landed in Scotland at Peterhead, but by the time he arrived at Perth on 9 January 1716, the Jacobite army numbered fewer than 5,000. In contrast, Argyll's forces had acquired heavy artillery and were advancing quickly. Mar decided to burn a number of villages between Perth and Stirling, so as to deprive Argyll's army of supplies. On 30 January Mar led the Jacobites out of Perth; on 4 February the Pretender wrote a farewell letter to Scotland, sailing from Montrose the following day. Many Jacobites who were taken prisoner were tried for treason and sentenced to death. The Indemnity Act of July 1717 pardoned all those who had taken part in the Rising, but the whole of the Clan Gregor, including Rob Roy MacGregor, was specifically excluded from the benefits of that Act. Another attempt, this time with Spanish support, was undertaken in 1719, only to end again in defeat in the Battle of Glenshiel. James's son Charles Edward Stuart attempted to win the throne for his father in 1745, in another Jacobite rising, but was defeated at the Battle of Culloden. James died in 1766.
Question: How many years after Charles Edward Stuart attempted to win the throne for his father in 1745 did he die?
Answer: 21