N = gets.to_i
*A = $<.read.split.map &:to_f
A.map! { 
  a = (_1 * 4_000_000_000 + 2).to_i >> 2
  i = j = 0
  i += 1  while a[i] == 0
  a >>= i
  a,r = a.divmod 5
  (j += 1; a,r = a.divmod 5)  while r == 0
  [i, j]
}
s = 0
(N-1).times {|i|
  a,b = A[i]
  (i+1...N).each {|j|
    c,d = A[j]
    s += 1  if [a+c,b+d].min >= 18
  }
} 
p s