n = gets.to_i
count = 0
negative = 0

for i in 0..n-1 do
  a = gets.to_i
  for j in 1..a/3 do
    for k in 1..a/3 do
      if 2 * j * k + j + k == a
        count = 1
        break
      end
    end
  end
  if count == 0
    negative = negative + 1
  end
  count = 0
end

puts negative

