who served as third president of the us?