Scientists studied marriage and birth records for 150,000 Icelandic couples – from 1800 through 1965 – to see if there was any connection between the relationship of the couple getting married versus the number of children the couple had.

What the scientists found was that marrying your third cousin offered the best chance of having a baby.

Women born between 1800-1824 who mated with their third cousin had more children (4.04) and grandchildren (9.17) than women who had children with someone who was related no closer than an eight cousin (with 3.34 children and 7.31 grandchildren). Similar birth differences held up as much as 100 years later, even when families were having fewer children.

The reasoning has to do with genetics, where close relatives can share genes that would reduce the chance of a miscarriage. The study showed that a person’s third and fourth cousins would share enough common genes to counterbalance any inbreeding disadvantages.