/**Lucky Boy**/
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define maxn 200005
#define maxm 1000006
#define maxc 1000000007
#define pii pair <int,int>
#define Task ""
#define double long double
template <typename T> inline void read(T &x){char c;bool nega=0;while((!isdigit(c=getchar()))&&(c!='-'));if(c=='-'){nega=1;c=getchar();}x=c-48;while(isdigit(c=getchar())) x=x*10+c-48;if(nega) x=-x;}
template <typename T> inline void writep(T x){if(x>9) writep(x/10);putchar(x%10+48);}
template <typename T> inline void write(T x){if(x<0){putchar('-');x=-x;}writep(x);putchar(' ');}
template <typename T> inline void writeln(T x){write(x);putchar('\n');}
const double Pi = acos(-1);
using namespace std;
int n,t[55][55];
pii a[maxn];
long long ans;
int Get(int u,int v)
{
    if (!u || !v) return 0;
    int res = 0;
    while (u)
    {
        int temp = v;
        while (temp)
        {
            res += t[u][temp];
            temp -= temp & -temp;
        }
        u -= u & -u;
    }
    return res;
}
void Update(int u,int v,int val)
{
    while (u <= 50)
    {
        int temp = v;
        while (temp <= 50)
        {
            t[u][temp] += val;
            temp += temp & -temp;
        }
        u += u & -u;
    }
}
int main()
{
    srand(time(NULL));
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie();
    if(fopen(".inp", "r")) freopen(".inp", "r", stdin);
    //freopen(Task".inp", "r",stdin);
    //freopen(Task".out", "w",stdout);
    cin >> n;
    FOR(i,1,n)
    {
        double x;cin >> x;
        long long u = round(x * 1e9);
        while (u % 2 == 0)
        {
            ++a[i].F;
            u >>= 1;
        }
        while (u % 5 == 0)
        {
            ++a[i].S;
            u /= 5;
        }
    }
    FOR(i,1,n)
    {
        int need2 = max(1,18 - a[i].F + 1),
            need5 = max(1,18 - a[i].S + 1);
        ans += Get(50,50);
        ans -= Get(need2 - 1,50);
        ans -= Get(50,need5 - 1);
        ans += Get(need2 - 1,need5 - 1);
        Update(a[i].F + 1,a[i].S + 1, 1);
    }
    cout << ans;
    return 0;
}

#include<bits/stdc++.h>
#define Imposter ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long int
#define ld long double
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
using namespace std;
#define f(n) for(ll i=0;i<n;i++)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define endl "\n"
#define vll vector<ll>
#define vlll vector<vll>
#define all(x) x.begin(),x.end()
int n;
inline void solve()
{
    cin>>n;
    int a[n+2];
    for(int i=1;i<=n;i++)
    cin>>a[i];
    a[0]=0;
    a[n+1]=0;
    ll sum=0;
    for(int i=1;i<n+2;i++)
    {
        sum+=abs(a[i]-a[i-1]);
    }
    //cout<<sum<<endl;
    for(int i=1;i<=n;i++)
    {
        cout<<sum-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+ abs(a[i+1]-a[i-1])<<endl;
    }
    
}
int main()
{
    Imposter
    
    int t=1;
    //cin>>t;
    while(t--)
    {
        cout<<fixed<<setprecision(10);
       solve();
        
    }
    return 0;
}