from itertools import*
n=int(input())
s=input()
t=[len(list(v)) for k,v in groupby(s)]
r=s.count("#")
l=0
ans=[r,s.count(".")]

if s[0]=="#":
    for i in range(0,len(t)//2+1,2):
        r-=t[i+1]
        l+=t[i]
        ans.append(r+l)
else:
    for i in range(1,len(t)//2+1,2):
        r-=t[i+1]
        l+=t[i]
        ans.append(r+l)
print(min(ans))