n = int(input())
s = list(str(input()))
a = 0
b = 0
for i in range(n):
  if s[i] == ".":
    a += 1
  else:
    break
for i in range(n):
  if s[-i-1] =="#":
    b += 1
  else:
    break
sb = s.count("#")
sw = s.count(".")
if sb-b>sw-a:
  print(sw-a)
else:
  print(sb-b)
