func powerOf(_ num: Int, by times: Int) -> Int {
    var timer = times
    var answer = 1
    while timer > 0 {
        answer *= num
        timer -= 1
    }
    return answer
}

func primeFactorizationbyTwoAndFive(num: Int) -> (two: Int, five: Int) {
    var twoCount = 0
    var fiveCount = 0
    var numRemainderForTwo = num
    var numRemainderForFive = num
    while numRemainderForTwo % 2 == 0 && twoCount < 19 {
        twoCount += 1
        numRemainderForTwo /= 2
    }
    while numRemainderForFive % 5 == 0 && fiveCount < 19 {
        fiveCount += 1
        numRemainderForFive /= 5
    }
    return (twoCount, fiveCount)
}

func main() {
    let n = Int(readLine()!)!
    var aList = [(Int, Int)]()
    let tenPoweredByNine = powerOf(10, by: 9)
    for _ in 0..<n {
        let aMultipledToInt = Int(Double(readLine()!)! * Double(tenPoweredByNine))
        let FactorOfTwoAndFive = primeFactorizationbyTwoAndFive(num: aMultipledToInt)
        aList.append(FactorOfTwoAndFive)
    }
    let count = aList.count
    var answer = 0
    for i in 1...count-1 {
        for j in i+1...count {
            if  aList[i-1].0+aList[j-1].0 >= 18 && aList[i-1].1+aList[j-1].1 >= 18 {
                answer += 1
            }
        }
    }
    print(answer)
}

main()

