n = int(input())
s = input()
ib = s.find('#')
cw = s[ib:].count('.')
cb = s.count('#')
if ib == -1:
  print('0')
elif cw >= cb:
  if s[-1] == '#':
  	iw = s.rfind('.')
  	print(cb - (n - 1 - iw))
  else:
  	print(cb)
else:
  print(cw)