// I make this just for fun because i'm done
// Aimi Haraguni >> Konomi Suzuki >> Yui >>  Ikimono Gakari >> Garnidelia >> Kalafina >> Eir Aoi.   .. dude? 
// problems that involves any kind of persistent data structures are the best of the best, are not them?
 
// #pragma GCC optimize ("Ofast,unroll-loops")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
 
#define pb push_back
#define ff  first
#define ss second
#define tm1 first
#define tm2 second.first
#define tm3 second.second
#define sz(x) ll(x.size())
#define all(v) (v).begin(), (v).end()
// #define fill(x, v) memset(x, v, sizeof(x))
#define FER(i,a,b) for(ll i=ll(a); i< ll(b); ++i)
#define IFR(i,a,b) for(ll i=ll(a); i>=ll(b); --i )
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
/*
// #define N 21000000
// #define M 19
// #define mod3 9
#define mod  998244353
#define mod1 1000000007
#define mod2 1000000009
*/
#define mod 1000000
#define bas 987625403
#define sqr(x) (x)*(x)  
#define INF 2000000000
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef pair<ll, ll> ii;
typedef pair<ll, ii > tri;
typedef vector<ll> vi;
typedef vector<vi> vv;
typedef vector<ii> vii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> S_t;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

#define trace(...) fff(#__VA_ARGS__, __VA_ARGS__)
template<typename t> void fff(const char* x, t&& val1) { cout<<x<< " : "<<val1<<"\n";}
template<typename t1, typename... t2> void fff(const char* x, t1&& val1, t2&&... val2){
    const char* xd=strchr(x+1, ',');
    cout.write(x, xd-x)<<" : "<<val1<<" | ";
    fff(xd+1, val2...);
}
inline ll add(ll a, ll b) { return a+b < mod? a+b : a+b-mod;}
inline ll rem(ll a, ll b) { return a >= b? a - b: a- b + mod;}
inline ll mul(ll a, ll b) { return (long long) a*b%mod;}
inline void Mul(ll &a, ll b) { a = (long long) a*b%mod;}
inline ll bp(ll a, ll p){
    ll ret;
    for(ret = 1; p; p>>=1, Mul(a, a)) (p & 1) && (Mul(ret, a), 1);
    return ret;
}
inline void read(ll &x) {cin>>x;}
ll pw[1<<19];
vi vec2[1<<7], vec5[1<<7];
int main(){
	ll n; cin>>n;
	vi tnt;
	pw[0] = 1;
	FER(i, 1, 18) pw[i] = pw[i-1]*10;
	vector<tri> froz;
	map<ii, ll> mt;
	FER(i, 0, n){
		string s; cin>>s;
		ll ans = 0, val = 0, t = 0, flag = 1;
		FER(j, 0, sz(s)){
			if(s[j] == '.'){
				t = sz(s) - j - 1;
				FER(k, j+1, sz(s)){
					val = (val *10) + s[k] - '0';
				}
				ll tot = ans*pw[t] + val, a = 0, b = 0;
				// trace(tot, i);
				while(tot%2 == 0) tot/=2, a++;
				while(tot%5 == 0) tot/=5, b++;
				// trace(t, i, tot, a, b);
				a += 9 - t;
				b += 9 - t;
				mt[{a, b}]++;
				vec2[a].pb(b);
				vec5[b].pb(a);
				// trace(a, b, i);
				flag = 0;
				break;
			}
			else{
				ans = (ans*10) + s[j] - '0';
			}
		}
		if(flag){
			ll a = 0, b = 0;
			// trace(ans, i);
			while(ans%2 == 0) ans/=2, a++;
			while(ans%5 == 0) ans/=5, b++;
			a += 9;
			b += 9;
			mt[{a, b}]++;
			// trace(a, b, i);
			vec2[a].pb(b);
			vec5[b].pb(a);
		}
	}
	FER(i, 0, 1<<6) sort(all(vec2[i]));
	// need 18, 18;
	long long ands = 0LL;
	FER(i, 0, 1<<6){
		for(auto xd: vec2[i]){
			// tengo xd, necesito 18-xd
			ll need = max(0LL, 18 - xd);
			// yo soy xd;
			// ll ret = (need >= xd and max(18-i, 0LL) >= i);
			// ands -= ret;
			FER(j, max(18-i, 0LL), 1<<6){
				auto R = lower_bound(all(vec2[j]), need) - vec2[j].begin();
				// trace(sz(vec2[j]), R);
				ll ret = (need <= xd and j ==  i);
				ands += 1LL*((sz(vec2[j])) - R - ret);
			}
		}
	}
	// trace(ands);
	ands>>=1;
	cout<<ands<<"\n";
	return 0;
}

Measured memory_bytes: 7316