#!/usr/bin/env ruby

require 'bigdecimal'

DIGIT = 10 ** 9
DIGIT2 = DIGIT ** 2

N = gets.chomp.to_i

A = []

N.times do |i|
  A[i] = (BigDecimal(gets.chomp) * DIGIT).to_i
end

count = 0

0.upto(N-2) do |i|
  (i+1).upto(N-1) do |j|
    value = A[i] * A[j]

    if value % DIGIT2 == 0
      count += 1
    end
  end
end

print count
