N=int(input())
S=[str(i) for i in input().split()][0]
try:
    start=S.index("#")
    end=max([n for n,i in enumerate(S) if i=="."])
    X=S[start:end+1]
    sharpn=[i for i,n in enumerate(X) if n=="#"]
    list=[X[sharpn[i]:sharpn[i+1]] for i in range(0,(len(sharpn)-1))]
    sharp=[i.count("#") for i in list]
    dot=[i.count(".") for i in list]
    sharpr=[i for i in reversed(sharp)]
    dotr=[i for i in reversed(dot)]
    res=[sum(dotr[0:i]+sharpr[i:len(dotr)]) for i in range(0,len(dotr))]
    res2=min(res)
    print(res2)
except:
    print(0)