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+1] = '#'
        
res3 = 0
b = 0
w = 0
for i in range(N):
    if K[i] == '#':
        b += 1
    else:
        w += 1

res3 = N - max(b, w)

print(min(res1, res3))