n = gets.chomp.to_i
a = Array.new(n,0)

a = a.map do
    s = gets.split(".")
    res = s[0].to_i*1000000000
    if s.size >1
        res += s[1].to_i*(10**(10-s[1].size))
    end
    res
end
cnt = Array.new(22).map{Array.new(22,0)}
dp = Array.new(22).map{Array.new(22,0)}
p = a.map do |e|
    c2 = c5 = 0
    while e%2==0
        e /= 2
        c2 += 1
    end
    
    while e%5==0
        e /= 5
        c5 += 1
    end
    cnt[[20,c2].min][[20,c5].min] += 1
    [c2,c5]
end

for i in 0..20
    for j in 0..20
        dp[i+1][j+1] = dp[i][j+1]+dp[i+1][j]-dp[i][j]+cnt[i][j];
    end
    # pp dp[i+1]
end
ans = 0
p.each do |e|
    c2,c5 = e
    t2 = [0,18-c2].max
    t5 = [0,18-c5].max
    ans += n-dp[t2][21]-dp[21][t5]+dp[t2][t5]
    ans -= 1 if c2 >= 9 && c5 >= 9
    # pp ans
end

puts ans/2

