N=input()
s=input()

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

if(s[N-1]=="."):
    a+=1
    bn.insert(0,a)
else:
    bn.insert(0,0)

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

#score算出
a=0
for i in range(N):
    now=bn[i]
    now+=a
    score.append(now)
    if(s[i]=="#"):
        a+=1
score.append(a)

score.sort()
print(score[0])