N = int(input())
S = list(input())
B_C = 0
W_C = 0
if S[0] == "#":
  for i in range(N):
      if S[i] == ".":
          W_C += 1
      elif S[i] == "#":
          B_C += 1
  #print(W_C,B_C)
  print(min(W_C,B_C))
else:
  K = 1
  for i in range(N-1):
    if S[i] == "." and S[i+1] == ".":
      K += 1
    else:
      break
  S = S[K:]
  for i in range(N-K):
    if S[i] == ".":
        W_C += 1
    elif S[i] == "#":
        B_C += 1
  #print(K,W_C,B_C)
  print(min(W_C,B_C))