import re
n = int(input())
s0 = input()
s = s0
c1 = 0
c2 = 0
while True:
  t = re.subn(r'#\.', "##", s)
  s = t[0]
  c1 += t[1]
  if t[1]==0:
    break
s = s0
while True:
  t = re.subn(r'#\.', "..", s)
  s = t[0]
  c2 += t[1]
  if t[1]==0:
    break
if c1 > c2:
  print(c2)
else:
  print(c1)