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

res1 = 0
for i in range(N-1):
    if S[i] == '#' and S[i+1] == '.':
        res1 += 1
        S[i+1] = '#'
        
res2 = 0
for i in range(N-1):
    if T[i] == '#' and T[i+1] == '.':
        res2 += 1
        T[i] = '.'
        
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, res2, res3))