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] == "#":
            l.append(c + s[i:N+1].count("."))
            c += 1
    print(min(l))

        

