N = int(input())
S = input()
black = [s=="#" for s in S]
ans = N - sum(black)
if sum(black)==0:
    ans = 0
for i in range(N):
    a = sum(black[:i])
    b = N-i-sum(black[i:])
    ans = min(ans,a+b)
print(ans)