n = int(input())
s = list(input())
ans = 10**6
b = [0]
w = [0]
for i in range(n):
    b.append(b[i]+(s[i]=="#"))
    w.append(w[i]+(s[i]=="."))
for i in range(n):
    #print(b[i+1],w[-1]-w[i+1])
    ans = min(ans,b[i+1]+w[-1]-w[i+1])
print(ans)