n=int(input())
s=input()
x=n
for i in range(n):
    if s[i]=="#":
      x=i
      break
for i in range(1,n):
    if s[n-i]=="#":
        s=s[:-i]
    else:
        break
b=s[x:].count("#") 
w=len(s[x:])-b
print(b if b<w else w)
