N = gets.to_i
A = Array.new(40){Array.new(40, 0)}

N.times do |i|
    s = gets.chomp
    num = 0
    if s.include?('.')
        ss = s.split('.')
        l = ss[1].size
        num = (ss[0].to_i * 10**l + ss[1].to_i) * 10**(9-l)
        A.push(num)
    else
        num = s.to_i * 10**9
    end
    n2 = 0
    n5 = 0
    while num%2 == 0 && n2 < 18
        n2 += 1
        num /= 2
    end
    while num%5 == 0 && n5 < 18
        n5 += 1
        num /= 5
    end
    A[n2][n5] += 1
end

B = Array.new(40){Array.new(40, 0)}
ans = 0
19.times do |i|
    19.times do |j|
        num = A[i][j]
        if i*2 >= 18 && j*2 >= 18
            ans += num*(num-1)/2
        end
        19.times do |x|
            19.times do |y|
                if i+x >= 18 && j+y >= 18
                    ans += num * B[x][y]
                end
            end
        end
        B[i][j] += num
    end
end
puts ans