N=int(input())
S=list(input())
whites=[0]*N
curwhi=0
for k,i in enumerate(S):
    if i==".":
        curwhi+=1
        whites[k]=curwhi
curmin=1000000
allwhi=whites[N-1]
for k,w in enumerate(whites):
    curmin=min(curmin,k+1+allwhi-2*w)
print(curmin)