n=int(input())
s=input()
s_list=list(s)
c=0
if s_list[0] == "#" and s_list[1] == ".":
  c += 1
  s_list[0] = "."
for a in range(n-2):
  if s_list[a+1] == "#" and s_list[a+2] ==  ".":
                     c += 1
                     s_list[a+2] = "#"
print(c)