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]
    sharp=X.count("#")
    dot=X.count(".")+1
    print(min([sharp,dot])) 
except:
    print(0)