#10**9 = 2**9*5**9

N = gets.to_i
A = Array.new N

def split n 
    n *= 10**9
    res = {
        2 => 0,
        5 => 0
    }
    while n % 10 == 0 do
        n /= 10
        res[2] += 1
        res[5] += 1
    end
    while n % 2 == 0 do
        n /= 2
        res[2] += 1
    end
    while n % 5 == 0 do
        n /= 5
        res[5] += 1
    end
    res
end
list = []
N.times do |i|
    A[i] = gets.to_f
    list.push(split(A[i]))
end

res = 0
list = list.sort_by{|x| x[2]}
while(x = list.pop) do
    break unless list[0]
    while(list[0] && x[2] + list[0][2] < 18) do
        break unless list.shift
    end
    list.each do |y|
        if x[5] + y[5] >= 18
            res += 1
        end
    end
end

puts res