N=input()
s=input()

N=int(N)
score=[]
wn=[]
bn=[]
a=0
b=0

for i in range(N):
    j=N-(i+1)
    if(s[j]=="."):
        a+=1
    if(s[i]=="#"):
        b+=1
    bn.insert(0,a)
    wn.append(b)
bn.append(0)
wn.insert(0,0)
#print(bn)
#print(wn)

#score算出
min=1000000
a=0
for i in range(N+1):
    score=bn[i]+wn[i]
    if(score<min):
        min=score

print(min)