N=int(input())
s=[i for i in input()]
L=R=True
ss=s[:]
for i in range(N):
    if L or R:
        if L and s[i]==".":
            ss.pop(0)
        else:
            L=False
        if R and s[-1-i]=="#":
            ss.pop(-1)
        else:
            R=False
    else:
        break
print(min(ss.count("."),ss.count("#")))            
