N = int(input())
S = input().rstrip()

fst = '.' if S[0:1] == '.' else '#'
snd = '.' if S[0:1] != '.' else '#'
result = 0

for i in range(len(S)):
    b1 = S[i:i+1]
    if i < N-1:
        b2 = S[i+1:i+2]
    else:
        break
    
    if b1 != b2:
        result += 1
        if b2 == fst:
            S = S[:i+1]+snd+S[i+2:]
        else:
            S = S[:i+1]+fst+S[i+2:]

print(result)