n=int(input())
s=list(str(input()))
l=[]
w=0
b=0
wl=[]
bl=[]
for i in range(n):
    if s[i]==".":
        w+=1
    else:
        b+=1
    wl.append(w)
    bl.append(b)
        
ans=[]
for i in range(n):
    ans.append(bl[i]+wl[n-1]-wl[i])
print(min(ans))
