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