N = int(input())
S = input()

ct = 0
if N >= 2:
    if S[0] != S[1]:
        ct += 1

    for i in range(N):
        if i % 4 <= 1:
            if S[i] != S[1]:
                ct += 1
        else:
            if S[i] == S[1]:
                ct += 1

print(ct)