who became the third president of the us after winning the election?