N = int(input())
S = input()
ans = 0
if N == 1:
    print(0)
    exit()
elif N == 2 and (S[0] == '#' and S[1] == '.'):
    print(1)
    exit()
else:
    S = '#' + S + '#'
    for n in range(N):
        if S[n] == '.' and S[n + 2] == '.' and S[n + 1] == '#':
            ans += 1
        elif S[n] == '#' and S[n + 2] == '#' and S[n + 1] == '.':
            ans += 1
print(ans)
