N = int(input())
s = input()
l = []
c = 0
ans = 10**6

if s.count("#")==0:
    print(0)
else:
    for i in range(N):
        if s[i] == "#":
            k = i
            aaa = s[i:N+1].count(".")
            ans = min(c + aaa, ans)
            c += 1
    print(ans)

        

