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