#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef NEAL_DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif

struct fraction {
    // CHECK_OVERFLOW64 = true can run up to 2.5 times slower (particularly on CF).
    static const bool CHECK_OVERFLOW64 = true;

    static const bool AUTO_REDUCE = true;

    static int cross_sign(const fraction &a, const fraction &b) {
        if (CHECK_OVERFLOW64) {
            long double double_value = (long double) a.numer * b.denom - (long double) b.numer * a.denom;

            if (abs(double_value) > 1e18)
                return double_value > 0 ? +1 : -1;
        }

        uint64_t uint64_value = (uint64_t) a.numer * b.denom - (uint64_t) b.numer * a.denom;

        if (uint64_value == 0)
            return 0;

        return uint64_value >> 63 ? -1 : +1;
    }

    int64_t numer, denom;

    fraction(int64_t n = 0, int64_t d = 1) : numer(n), denom(d) {
        check_denom();

        if (AUTO_REDUCE)
            reduce();
    }

    void check_denom() {
        assert(denom != 0);

        if (denom < 0) {
            numer = -numer;
            denom = -denom;
        }
    }

    void reduce() {
        int64_t g = __gcd(abs(numer), denom);
        numer /= g;
        denom /= g;
    }

    bool is_integer() const {
        return denom == 1;
    }

    friend fraction operator+(const fraction &a, const fraction &b) {
        return fraction(a.numer * b.denom + b.numer * a.denom, a.denom * b.denom);
    }

    friend fraction operator-(const fraction &a, const fraction &b) {
        return fraction(a.numer * b.denom - b.numer * a.denom, a.denom * b.denom);
    }

    friend fraction operator*(const fraction &a, const fraction &b) {
        return fraction(a.numer * b.numer, a.denom * b.denom);
    }

    friend fraction operator/(const fraction &a, const fraction &b) {
        return fraction(a.numer * b.denom, a.denom * b.numer);
    }

    fraction& operator+=(const fraction &other) { return *this = *this + other; }
    fraction& operator-=(const fraction &other) { return *this = *this - other; }
    fraction& operator*=(const fraction &other) { return *this = *this * other; }
    fraction& operator/=(const fraction &other) { return *this = *this / other; }

    fraction& operator++() { numer += denom; return *this; }
    fraction& operator--() { numer -= denom; return *this; }

    fraction operator++(int) { fraction before = *this; ++*this; return before; }
    fraction operator--(int) { fraction before = *this; --*this; return before; }

    fraction operator-() const {
        return fraction(-numer, denom);
    }

    fraction inv() const {
        return fraction(denom, numer);
    }

    bool operator==(const fraction &other) const { return cross_sign(*this, other) == 0; }
    bool operator!=(const fraction &other) const { return cross_sign(*this, other) != 0; }
    bool operator<(const fraction &other) const { return cross_sign(*this, other) < 0; }
    bool operator>(const fraction &other) const { return cross_sign(*this, other) > 0; }
    bool operator<=(const fraction &other) const { return cross_sign(*this, other) <= 0; }
    bool operator>=(const fraction &other) const { return cross_sign(*this, other) >= 0; }

    double to_double() const {
        return double(numer) / double(denom);
    }

    long double to_long_double() const {
        return (long double) numer / (long double) denom;
    }

    fraction to_abs() const {
        return fraction(abs(numer), denom);
    }

    friend ostream& operator<<(ostream& out, const fraction &frac) {
        return out << frac.numer << '/' << frac.denom;
    }
};


int main() {
    ios::sync_with_stdio(false);
#ifndef NEAL_DEBUG
    cin.tie(nullptr);
#endif

    const int64_t BASE = 1e9;

    auto &&decimal_to_fraction = [](string str) {
        size_t period = str.find('.');

        if (period == string::npos)
            return fraction(stoll(str));

        string decimal = str.substr(period + 1);

        while (decimal.size() < 9)
            decimal += '0';

        int64_t before = stoll(str.substr(0, period));
        int64_t after = stoll(decimal);
        return fraction(before * BASE + after, BASE);
    };

    auto &&decimal_to_number = [&](string str) {
        fraction f = decimal_to_fraction(str);
        array<int, 2> values = {2, 5};
        array<int, 2> powers = {0, 0};

        for (int i = 0; i < 2; i++) {
            while (f.numer % values[i] == 0) {
                powers[i]++;
                f.numer /= values[i];
            }

            while (f.denom % values[i] == 0) {
                powers[i]--;
                f.denom /= values[i];
            }
        }

        return powers;
    };

    int N;
    cin >> N;
    vector<array<int, 2>> numbers;
    int integers = 0;

    for (int i = 0; i < N; i++) {
        string str;
        cin >> str;
        numbers.push_back(decimal_to_number(str));

        if (numbers.back()[0] >= 0 && numbers.back()[1] >= 0)
            integers++;
    }

    sort(numbers.begin(), numbers.end());
    int64_t total = 0;

    const int P_MAX = 100;

    vector<int> freq(2 * P_MAX + 1, 0);

    for (int i = 0, j = N; i < N; i++) {
        while (j > 0 && numbers[i][0] + numbers[j - 1][0] >= 0) {
            j--;
            freq[P_MAX + numbers[j][1]]++;
        }

        for (int x = -numbers[i][1]; x < P_MAX; x++)
            total += freq[P_MAX + x];
    }

    total -= integers;
    assert(total % 2 == 0);
    total /= 2;
    cout << total << '\n';
}


Measured memory_bytes: 5300