n = gets.to_i
c = 19.times.map{[0]*19}
n.times{
  a=9
  b=9
  r = gets.to_r
  while r.denominator>1
    a -= 1
    b -= 1
    r *= 10
  end
  while r.numerator%2==0
    a += 1
    r /= 2
  end
  while r.numerator%5==0
    b += 1
    r /= 5
  end
  a = [a, 18].min
  b = [b, 18].min
  c[a][b] += 1
}
ans = 0
19.times.each do |i|
  19.times.each do |j|
    ans -= c[i][j] if i>=9&&j>=9
    (18-i..18).each do |_i|
      (18-j..18).each do |_j|
        ans += c[i][j]*c[_i][_j]
      end
    end
  end
end
p ans/2