let n:Int = Int(readLine()!)!
var l:[[Int]] = Array(repeating:[0,0],count:n)
for i in 0..<n {
  let a = readLine()!
  if a.contains(".") {
    let a2 = a.split(separator:".")
    l[i] = [Int(a2[0]+a2[1])!,a2[1].count]
  } else {
    l[i] = [Int(a)!,0]
  }
}
var c = 0
for j in 1..<n {
  for i in 0..<j {
    if l[i][0]*l[j][0] % Int("1"+String(repeating:"0",count:l[i][1]+l[j][1]))! == 0 {
      c += 1
    }
  }
}
print(c)