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

if S[0] == "#" or S[-1] == ".":
  w = S.count(".")
  print(min(w, N - w))
else:
  bw = []
  for i in range(N):
    if i == 0 or S[i] != S[i - 1]:
      bw.append(1)
    else:
      bw[-1] += 1
  
  ans = float("inf")
  for i in range(len(bw)):
    tmp = 0
    for j in range(len(bw)):
      if j < i and j % 2 == 1:
        tmp += bw[j]
      elif j >= i and j % 2 == 0:
        tmp += bw[j]
      ans = min(ans, tmp)
  print(ans)