n = int(input())
s = list(input())
count = [0] * n
count[0] = s[0:1].count("#") + s[1:n].count(".")

if s.count(".") != n and s.count("#") != n:
 for i in range(1,n):
  if s[i] == "#":
   count[i] = count[i-1] + 1
  else:
   count[i] = count[i-1] - 1

print(min(count))