#coding:utf-8
N = int(input())
S = input()
ans = 1000000
for i in range(N+1):
    l = S[:i]
    r = S[i:]
    #print (l,r)
    cnt = l.count("#")+r.count(".")
    #print (cnt)
    if cnt < ans:
        ans = cnt
print (ans)
