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

if s.count("#")==0:
    print(0)
else:
    for i in range(N):
        if s[i] == "#":
            if d != 0:
                c += 1
                d += 1
            else:
                l.append(c + s[i:N+1].count("."))
                c += 1
                d += 1
        d = 0
    print(min(l))

        

