*A = $<.read.scan /[\d.]+/
N = A.shift.to_i
C = (0...19).map { [0]*19 }
s = 0
A.each {|a|
  a,r = a.split ?.
  a = a.to_i
  i=j=k = 0
  if r && 0 < (b=r.to_i)
    a *= 10 ** (k=r.size)
    a += b
  end
  i += 1  while a[i] == 0
  a >>= i
  i = [i-k+9,18].min
  b,r = a.divmod 625
  (j += 4; b,r = (a=b).divmod 625)  while r == 0
  a,r = a.divmod 5
  (j += 1; a,r = a.divmod 5)  while r == 0
  j = [j-k+9,18].min
  s += C[18-i,18].sum { |c| c[18-j,18].sum }
  C[i][j] += 1
}
p s