Imports System

Module Program
    Sub Main(args As String())

        Dim N As Integer = Integer.Parse(Console.ReadLine())
        Dim A As New List(Of Decimal)
        For i As Integer = 0 To N - 1
            Dim tmp As String = Console.ReadLine()
            A.Add(Decimal.Parse(tmp) * 10 ^ 9)
        Next

        Dim ans As Integer = 0
        For i As Integer = 0 To N - 2
            For j As Integer = i + 1 To N - 1
                Dim tmp As String = CStr(A(i) * A(j))
                If Right(tmp, 18) = "000000000000000000" Then
                    ans += 1
                End If
            Next
        Next

        Console.WriteLine(ans)

    End Sub
End Module
