n=int(input())
s=list(str(input()))
w=0
b=0
wl=[]
bl=[]
for i in range(n):
    if s[i]==".":
        w+=1
    else:
        b+=1
    wl.append(w)
    bl.append(b)
if "#" not in s or "." not in s:
    print(0)
elif s.count(".")==1:
    print(1)
else:
    ans=[]
    for i in range(n):
        ans.append(bl[i]+wl[-1]-wl[i])
    print(min(ans))
