n=input()
s=input()
char_list = list(s)

count = 0
for i in range(int(n)-1):
  if char_list[i] == '#' and char_list[i+1] == '.':
      char_list[i+1] = '#'
      count +=1

if count <= s.count('#'):
  print(count)
else:
  print(s.count('#'))
