N = int(input())
S = input()
S = list(S)
K = S.copy()

res1 = 0
for i in range(N-1):
    if S[i] == '#' and S[i+1] == '.':
        res1 += 1
        S[i] = '.'

res2 = 0
for i in range(N-1):
    if K[i] == '#' and K[i+1] == '.':
        res2 += 1
        K[i+1] = '#'

print(min(res1, res2))