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

for i in range(2**N):
  T = ""
  tmp = 0
  sw = False
  for j in range(N):
    if (i >> j) & 1:
      T += "." if S[j] == "#" else "#"
      tmp += 1
    else:
      T += S[j]
  for k in T:
    if k == "#":
      if sw == False:
        sw = True
      else:
        continue
    if k == ".":
      if sw == False:
        continue
      else:
        tmp = N
        break
  ans = min(ans, tmp)
print(ans)