
N = int(input())
S = list(str(input()))
cnt = 0

for i in range(N-1):
    if S[i] == S[i+1]:
        pass
    else:
        cnt += 1
        if S[i+1] == '#':
           S[i+1] = '.'
        else:
            S[i+1] = '#'
print(cnt)