n = int(input())
S = list(input())
ans = 0
for i in range(1,n):
    left =  S[0:i]
    right = S[i:0]
    if left.count('.') + right.count('#') < ans:
        ans = left.count('.') + right.count('#')

print(ans)