import Counter

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

black = s.count('.')
white = s.count('#')
count = 0
if black > white:
 for i in range(n):
  if s[i] == '#':
   s[i+1] = '#'
   count += 1
else:
 for i in range(n):
  if s[i] == '.'
   s[i+1] = '.'
   count += 1

print(count)