n=int(input())
s=input()
from itertools import groupby
gr=groupby(s)
c=[]
for k,g in gr:
  c.append((k,len(list(g))))
# print(c)
b,w=0,0
b=s.count("#")

f=False
for k,v in c:
  if f:
    if k==".":
      w+=v
      f=False
  else:
    if k=="#":
      f=True
if s[-1]=="#":
  b-=c[-1][1]
print(min(b,w))