import copy
N = int(input())
S = list(input())
T = copy.copy(S)
ans = 0
ans2 = 0
for i in range(N-1):
    if S[i] == '#' and S[i+1] == '.':
        ans += 1
        S[i+1] = '#'
for i in range(N-1):
    if T[i] == '#' and T[i+1] == '.':
        ans2 += 1
        T[i] = '.'
print(min(ans, ans2))
