N = int(input())
S = input()
 
def white2black():
  most_left_black = S.index('#')
  if most_left_black == len(S) - 1:
    return 0
  else:
    subS = S[most_left_black + 1:]
    num_to_replace = subS.count('.')
    return num_to_replace

def black2white():
  if not '.' in S:
    return 0
  else:
    most_right_white = max([i for i, c in enumerate(S) if c == '.' ])
    subS = S[:most_right_white]
    num_to_replace = subS.count('#')
    return num_to_replace
 
if not '#' in S:
  print(0)
else:
  print(min(white2black() , black2white()))