Well, not quite. The first barge landing, Flight 14, failed because the rocket ran out of hydraulics before landing safely. The second attempt, Flight 17, failed because the throttle control wasn't fine enough to allow a soft landing, again resulting in a hard crash. On Flight 20, they managed to land safely on dry land. Finally, on 21, they got the rocket onto the barge safely, but then had it failed.
So, in conclusion, they had two failures in getting the rocket onto the pad at safe speeds, one perfect landing and one where the landing went fine, but one leg failed.