def solution2(S):
    (ans1, ans2) = (0, 0)
    (check1, check2) = (0, 1)
    for i in S:
        if (i != check1):
            ans1 += 1
        if (i != check2):
            ans2 += 1
        check1 = (0 if (check1 == 1) else 1)
        check2 = (0 if (check2 == 1) else 1)
        assert (check1 != check2)
    print('ans1 : {}, ans2 : {}'.format(ans1, ans2))
    return min(ans1, ans2)
def solution2(S):
    (ans1, ans2) = (0, 0)
    (check1, check2) = (0, 1)
    for i in S:
        if (i != check1):
            ans1 += 1
        if (i != check2):
            ans2 += 1
        check1 = (0 if (check1 == 1) else 1)
        check2 = (0 if (check2 == 1) else 1)
        assert (check1 != check2)
    print('ans1 : {}, ans2 : {}'.format(ans1, ans2))
    return min(ans1, ans2)