John Quincy Adams is the only president to have lost both the popular vote and electoral vote and still become president.