n = int(input())
s=input()
bc = [0 for i in range(n)]
wc = [0 for i in range(n)]
for i in range(n):
    if s[i] == '#':
        bc[i] =1
    else:
        wc[i] = 1
for i in range(n-1):
    bc[i+1] += bc[i]
for i in range(n-1,0,-1):
    wc[i-1] += wc[i]
bc.insert(0,0)
wc.insert(0,0)
bc.append(0)
wc.append(0)
ans = n
for i in range(n-1):
    ans = min(ans,bc[i]+wc[i+1])
print(ans)