from itertools import*
n=int(input())
s=input()
t=0
r=s.count(".")
 

x=[[k,len(list(v))]for k,v in groupby(s)]
#print(x)
l=[]
for n,m in x:
    if n==".":
        r-=m
    else:
        t+=m
    l.append(r+t)
print(min(l))