In the first year, there's a special rule that basically waives the earnings limit so you get your full benefit in the months you are ertired, even if you exceeded the annual limit (calendar year) in the months before you retired/started taking benefits.
http://www.ssa.gov/retire2/rule.htm