n = int(input())
s = input()

if '.' not in s or '#' not in s:
  print(0)
elif '#.' not in s:
  print(0)
else:
  if s[n-1] == '#':
    s = s[:s.rfind('.')+1]
  if '#.' in s:
    s = s[s.find('#'):]
  print(min(s.count('.'), s.count('#')))
