def ans():
  from itertools import groupby
  N = int(input())
  S = input()
  b = 0
  w = 0
  for k, v in groupby(S):
    v = len(list(v))
    if k == "#":
      b += v
    else:
      w += v
  print(min(b,w))
ans()