N=int(input())
S=input()
s=list(S)

cw=0
cb=0

m=0

for j in reversed(range(N)):
    if s[j]=="#":
        m=m+1
    else:
        break

n=0

for k in range(N):
    if s[k]==".":
        n=n+1
    else:
        break

for i in range(n,N-m):
    if s[i]==".":
        cw=cw+1
    if s[i]=="#":
        cb=cb+1

print(min(cw,cb))