using System;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System.Collections.Generic;

class Myon

{
    public Myon() { }
    public static int Main()
    {
        cin = new Scanner();
        new Myon().calc();
        return 0;
    }
    static Scanner cin;


    void calc()
    {
        int N = cin.nextInt();
        int[] num2 = new int[N];
        int[] num5 = new int[N];

        int MAX = 18;
        int[,] sum = new int[MAX + 2, MAX + 2];

        for (int i = 0; i < N; i++)
        {
            string S = cin.next();
            int pnum = -1;
            long now = 0;

            foreach (var c in S)
            {
                if(c == '.')
                {
                    pnum = 0;
                }
                else
                {
                    now *= 10;
                    now += (c - '0');
                    if (pnum >= 0) pnum++;
                }
            }

            if (pnum == -1) num2[i] = num5[i] = MAX / 2;
            else num2[i] = num5[i] = MAX / 2 - pnum;

            while(now % 2 == 0)
            {
                now /= 2; num2[i]++;
            }
            while(now % 5 == 0)
            {
                now /= 5; num5[i]++;
            }
            num2[i] = Math.Min(MAX, num2[i]);
            num5[i] = Math.Min(MAX, num5[i]);

            sum[num2[i], num5[i]]++;
        }

        for (int i = MAX; i >= 0; i--)
        {
            for (int j = MAX; j >= 0; j--)
            {
                sum[i, j] += sum[i + 1, j];
                sum[i, j] += sum[i, j + 1];
                sum[i, j] -= sum[i + 1, j + 1];
            }
        }

        long ans = 0;
        for (int i = 0; i < N; i++)
        {
            int need2 = MAX - num2[i];
            int need5 = MAX - num5[i];
            ans += sum[need2, need5];
            if (need2 <= MAX / 2 && need5 <= MAX / 2) ans--;

        }

        ans /= 2;

        Console.WriteLine(ans);
    }
}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 41876