from itertools import*
n=int(input())
s=input()
t=[len(list(v)) for k,v in groupby(s)]
r=s.count("#")
ans=[r]
l=0
if s[0]=="#":
    for i in range(2,len(t),2):
        l+=t[i-1]
        r-=t[i]
        ans.append(l+r)
else:
    for i in range(1,len(t),2):
        l+=t[i-1]
        r-=t[i]
        ans.append(l+r)
print(min(ans))