How many votes before Pope Benedict was elected?

He was elected on the third ballot but, since the votes were so close to the runner up, he requested a 4th ballot to confirm the election. This according to a journal left by a cardinal in attendance at the conclave who has since passed away. That runner up, by the way, is our current Pope Francis. Officially, Benedict was elected on the 4th ballot.