main=getLine>>=print.(\x->f (length x) x 0 0)
 where f 0 _ i j = min i j
       f n (b:x) i j |even n = f (n-1) x (i+(read[b])) (j+1-(read[b]))
                     |odd n  = f (n-1) x (j+1-(read[b])) (i+(read[b]))