n = int(input())
s = str(input())
b = []
nb = 0
w = []
nw = 0
for s_ in s:
  if s_ == "#":
    nb += 1
  if s_ == ".":
    nw += 1
  b.append(nb)
  w.append(nw)
ans = []
#print(b)
#print(w)
for i in range(n):
  if i == n-1 and s[i] == ".":
    ans.append(b[i]+1)
  elif i == 0 and s[i] == "#":
    ans.append(w[n-1]-w[i])
  else:
    ans.append(b[i]+w[n-1]-w[i])
#print(ans)
if n == 1:
  print("0")
else:
  print(min(ans))
