N=int(input())
S=input()
#A,B,C=map(int,input().split())
#A=list(map(int,input().split()))
T=""
whi=0
bla=0
S_=""
c1=0
for i in S:
    if i=="#":
        break
    c1+=1
for i in S:
    T=i+T
    if i==".":
        whi+=1
    else:
        bla+=1
c2=0
for i in T:
    if i==".":
        break
    c2+=1
"""
print(whi)
print(bla)
print(c1)
print(c2)
print(T)
"""
print(min(whi-c1,bla-c2))
