n = int(input())
s = input()

min = n
i = -1
for j in range(n):
  j = s.find(".#", i + 1)
  if j < 0:
    break
  a = s[:j+1].count("#") + s[j+1:].count(".")
  if a < min:
    min = a
  i = j
print(min)