N = int(input())
S = str(input())
s = list(S)
if '#' in s:
  id = s.index('#')
  s_a = s[0:id]
  s_b = s[id+1:N-1]
  a = s_a.count('#')
  b = s_b.count('.')
  if a > b:
    print(a)
  else:
    print(b)
else:
  print(0)