import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val n = jin.readLine().toInt()
    val freq = Array(51) { LongArray(51) }
    for (j in 1..n) {
        val s = jin.readLine()
        var res = s.substringBefore('.').toLong()
        if ('.' in s) {
            val t = s.substringAfter('.')
            for (j in 1..t.length) {
                res *= 10L
            }
            res += t.toLong()
            for (j in 1..9 - t.length) {
                res *= 10L
            }
        } else {
            for (j in 1..9) {
                res *= 10L
            }
        }
        var e = 0
        while (res % 2L == 0L) {
            e++
            res /= 2L
        }
        var f = 0
        while (res % 5L == 0L) {
            f++
            res /= 5L
        }
        freq[e][f]++
    }
    var answer = 0L
    for (e1 in 0..50) {
        for (f1 in 0..50) {
            for (e2 in 0..50) {
                for (f2 in 0..50) {
                    if (e1 + e2 >= 18 && f1 + f2 >= 18) {
                        answer += freq[e1][f1] * freq[e2][f2]
                        if (e1 == e2 && f1 == f2) {
                            answer -= freq[e1][f1]
                        }
                    }
                }
            }
        }
    }
    answer /= 2L
    println(answer)
}