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

white = S.count(".")
black = N - white
ans_w = white
ans_b = black

S_reverse = S[::-1]
for s in S_reverse:
  if s == "#":
    ans_b -= 1
  else:
    break

for s in S:
  if s == ".":
    ans_w -= 1
  else:
    break

print(min(ans_b, ans_w))