n = input()
s = list(raw_input())
count = 0
count_a = s.count("#")

for i in range(n-1,0,-1):
 if s[i] == "#" and s[i-1] == "#":
  count_a -= 1
 else:
  if count_a != 0:
   count_a -= 1
  break

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

print min(count,count_a)