N = int(input())
S = input()
ans = S.count(".")
for x in range(N):
    count = S.count("#",0,x) + S.count(".",x+1,N)
    if count < ans:
        ans = count
count = S.count("#")
if count < ans:
    ans = count
print(ans)