Succession to the British throne is determined by descent, gender, legitimacy, and religion. Under common law, the Crown is inherited by a sovereign's children or by a childless sovereign's nearest collateral line. The Bill of Rights 1689 and the Act of Settlement 1701 restrict succession to the throne to the legitimate Protestant descendants of Sophia of Hanover who are in "communion with the Church of England". Spouses of Catholics were disqualified from 1689 until the law was amended in 2015. Protestant descendants of those excluded for being Roman Catholics are eligible. King Charles III is the sovereign, and his heir apparent is his elder son, William, Prince of Wales. William's eldest child, Prince George, is second in line, followed by George's younger sister, Princess Charlotte, before her younger brother, Prince Louis. Fifth in line is Prince Harry, Duke of Sussex, the younger son of the King; sixth is Harry's elder child, Archie Mountbatten-Windsor. Under the Perth Agreement, which came into effect in 2015, only the first six in line of succession require the sovereign's consent before they marry; without such consent, they and their children would be disqualified from succession. The first four individuals in the line of succession who are over 21, and the sovereign's consort, may be appointed counsellors of state. Counsellors of state perform some of the sovereign's duties in the United Kingdom while the sovereign is out of the country or temporarily incapacitated. Otherwise, individuals in the line of succession need not have specific legal or official roles. The United Kingdom is one of the Commonwealth realms, which are sovereign states that share the same person as monarch and the same order of succession. In 2011, the prime ministers of the then-16 realms agreed unanimously to amend the rules of succession. Male-preference primogeniture was abandoned, meaning that males born after 28 October 2011 no longer precede females in line, and the ban on marriages to Catholics was lifted. The monarch still needs to be in communion with the Church of England. After the necessary legislation had been enacted in accordance with each realm's constitution, the changes took effect on 26 March 2015. Current line of succession No official, complete version of the line of succession is maintained. The exact number, in more remote collateral lines, of the people who would be eligible is uncertain. In 2001, American genealogist William Addams Reitwiesner compiled a list of 4,973