#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <queue>
using namespace std;

int64_t min(int64_t a,int64_t b) {
    if (a > b)
    {
        return b ;
    }else
    {
        return a ;
    }
}

int64_t gcd(int64_t a,int64_t b){
    if(a < b)
    {
        int64_t temp = a;
        a = b ;
        b = temp;
    }
    int64_t copya = a;
    int64_t copyb = b;
    int64_t r = a%b ;
    while (r != 0)
    {
        a = b ;
        b = r ;
        r = a%b ;
    }
    return b ;
    
}


int main(){    
    int n ;
    cin >> n ;
    vector<pair<int64_t,int64_t> > a(n,pair<int64_t,int64_t>()) ;
    string s ;
    bool flag ;
    vector<vector<int> > have(n,vector<int>(4,0)) ;
    vector<vector<vector<vector<int> > > > p(10,vector<vector<vector<int> > >(10,vector<vector<int> >(10,vector<int>(10,0)))) ;
    for (int i = 0; i < n; i++)
    {
        cin >> s ;
        a.at(i).first = 0 ;
        a.at(i).second = 1 ;
        flag = 0 ;
        for (size_t j = 0; j < s.size(); j++)
        {
            if (s.at(j) == '.')
            {
                flag = 1 ;
            }
            else
            {
                a.at(i).first = a.at(i).first * 10 + (s.at(j) - '0') ;
                if (flag == 1)
                {
                    a.at(i).second *= 10 ;
                }
                
            }
            
            
        }
        int64_t g = gcd(a.at(i).first,a.at(i).second) ;
        a.at(i).first /= g ;
        a.at(i).second /= g ;
        int two = 0 ;
        int five = 0 ;
        int copy = a.at(i).first ;
        int two2 = 0 ;
        int five2 = 0 ;
        int copy2 = a.at(i).second ;
        for (int i = 0; i < 9; i++)
        {
            if (copy % 2 == 0)
            {
                copy /= 2;
                two ++ ;
            }else
            {
                break ;
            }
            
        }
        for (int i = 0; i < 9; i++)
        {
            if (copy % 5 == 0)
            {
                copy /= 5;
                five ++ ;
            }else
            {
                break ;
            }
            
        }
        for (int i = 0; i < 9; i++)
        {
            if (copy2 % 2 == 0)
            {
                copy2 /= 2;
                two2 ++ ;
            }else
            {
                break ;
            }
            
        }
        for (int i = 0; i < 9; i++)
        {
            if (copy2 % 5 == 0)
            {
                copy2 /= 5;
                five2 ++ ;
            }else
            {
                break ;
            }
            
        }
        have.at(i).at(0) = two ;
        have.at(i).at(1) = five ;
        have.at(i).at(2) = two2 ;
        have.at(i).at(3) = five2 ;
        p.at(two).at(five).at(two2).at(five2) ++ ;
    }
    for (int i = 0; i < 10; i++)
    {
        for (int j = 0; j < 10; j++)
        {
            if (i == 0 && j == 0)
            {
                continue ;
            }if (i == 0)
            {
                for (int k = 0; k < 10; k++)
                {
                    for (int l = 0; l < 10; l++)
                    {
                        p.at(9-i).at(9-j).at(k).at(l) += p.at(9-i).at(9-j+1).at(k).at(l) ;
                    }
                    
                }
                
            }else if (j == 0)
            {
                for (int k = 0; k < 10; k++)
                {
                    for (int l = 0; l < 10; l++)
                    {
                        p.at(9-i).at(9-j).at(k).at(l) += p.at(9-i+1).at(9-j).at(k).at(l) ;
                    }
                    
                }
            }else
            {
                for (int k = 0; k < 10; k++)
                {
                    for (int l = 0; l < 10; l++)
                    {
                        p.at(9-i).at(9-j).at(k).at(l) += p.at(9-i+1).at(9-j).at(k).at(l) + p.at(9-i).at(9-j+1).at(k).at(l) - p.at(9-i+1).at(9-j+1).at(k).at(l);
                    }
                    
                }
            }
            
            
            
            
        }
        
    }
    for (int i = 0; i < 10; i++)
    {
        for (int j = 0; j < 10; j++)
        {
            for (int k = 0; k < 10; k++)
            {
                for (int l = 0; l < 10; l++)
                {
                    if (k == 0 && l == 0)
                    {
                        continue ;
                    }else if (k == 0)
                    {
                        p.at(i).at(j).at(k).at(l) += p.at(i).at(j).at(k).at(l-1) ;
                    }else if (l == 0)
                    {
                        p.at(i).at(j).at(k).at(l) += p.at(i).at(j).at(k-1).at(l) ;
                    }
                     else
                    {
                        p.at(i).at(j).at(k).at(l) += p.at(i).at(j).at(k-1).at(l) + p.at(i).at(j).at(k).at(l-1) - p.at(i).at(j).at(k-1).at(l-1) ;
                    }
                    
                    
                    
                }
                
            }
            
        }
        
    }
    int64_t ans = 0 ;
    for (int i = 0; i < n; i++)
    {
        ans += p.at(have.at(i).at(2)).at(have.at(i).at(3)).at(have.at(i).at(0)).at(have.at(i).at(1)) ;
        if (a.at(i).second == 1)
        {
            ans -- ;
        }
        

    }
    
    ans /= 2 ;
    
        cout << ans << endl ;
    
    
}


Measured memory_bytes: 17464