import sys
index = int(input())
s = list(input())

count = 0
check = True
while True:
  t = 0
  for i in range(index-1):
    if s[i] == '#' and s[i+1] == '.':
      count += 1
      s[i] = '.'
    else:
      t += 1
  if t+1 == index:
    print(count)
    sys.exit(0)
  
      
        
  