N = int(input())
S = input()
lS = list(S)

ans = N
for i in range(0, N):
    left = lS[:i].count('#')
    right = lS[i:].count('.')
    ans = min(ans, left+right)

if ans == N:
    ans = 0

print(ans)