N = int(input())
S = input()
cnt1 = 0
S1 = S
judge = False
for i in range(1, N):
  if cnt1 == S.count("#") or S.count("."):
    break
  for j in range(1, N):
    if S1[j-1] == "#" and S1[j] == ".":
      if S.count("#") > S.count("."):
        S1 = S1.replace(S1[j-1], ".", 1)
      else:
        S1 = S1.replace(S1[j], "#", 1)
      cnt1 += 1
print(min(cnt1,S.count("#"), S.count(".")))