N = int(input())
S = input()

if not '#' in S:
  print(0)
else:
  most_left_black = [c for c in S].index('#')

  if most_left_black == len(S) - 1:
    print(0)
  else:
    subS = S[most_left_black + 1:]
    num_to_replace = subS.count('.')
    print(num_to_replace)
