REUTERS/Jonathan Ernst

They say you should keep your friends close and your enemies closer. Luckily for President Obama, two of his biggest detractors are actually members of his family.

According to genealogy site Ancestry.com, President Obama and Sarah Palin are tenth cousins, through ancestor John Smith. He’s also tenth cousins with Rush Limbaugh through ancestor Richmond Terrell. And Obama, Palin and President George W. Bush are all related through Samuel Hinckley. If it makes Obama feel any better, he’s also related to Brad Pitt and Warren Buffett. (See pictures of Sarah Palin and the Tea Party.)

“This election season is an ideal time to look into the family trees of our candidates and their critics,” genealogist Anastasia Tyler said in a statement, “to learn more about the ties that make them all part of this great country.” (See pictures of Obama’s first year in office.)

So even if Congress can’t get along, at least family trees can be bipartisan.