import re

pattern_black = re.compile('#')
pattern_white = re.compile(r'\.')
n = int(input()) 
stones = input()
count = 0


for i in range(1, len(stones)):
  if pattern_black.match(stones[i-1]) and pattern_white.match(stones[i]):
    stones = stones[:i] + '#' + stones[i+1:]
    count += 1
    
print(count)