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

white = S.count(".")
black = N - white
ans = 0

if white > black:
  ans = black
  S_reverse = S[::-1]
  for s in S_reverse:
    if s == "#":
      ans -= 1
    else:
      break
else:
  ans = white
  for s in S:
    if s == ".":
      ans -= 1
    else:
      break

print(ans)