N = int(input())
S = str(input())
s = list(S)
if '#' in s:
  for i in range(N):
    if s.[-1] == '#':
      s.pop(-1)
  id = s.index('#')
  if id == N-1:
    print(0)
  else:
    s_b = s[id:N-1]
    b1 = s_b.count('#')
    b2 = s_b.count('.')
    if b2 == 0:
      print(0)
    elif b1 > b2:
      print(b2)
    else:
      print(b1)
else:
  print(0)