I believe (but I don't have the reference with me so I may be wrong) that in the Middle Ages, any degree of consanguinity (up to 6th cousins!) meant that marriage was prohibited unless you got papal dispensation. Since nearly all the royal and noble houses were inter-related, this meant that the Pope had to give permission for an awful lot of proposed matches.