#pragma region RegionDefs
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,l,r) for(int i=(l),i##_len=(r);i<i##_len;++i)
#define repr(i,l,r) for(int i=(r)-1,i##_left=(l);i>=i##_left;--i)
#define all(x) begin(x),end(x)
using namespace std;
typedef long long ll;
const ll INF = 1e9;
template<class T=ll> using V = vector<T>;
template<class T=ll> using PQ = priority_queue<T>;
template<class T=ll> using PQG = priority_queue<T, V<T>, greater<T>>;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail) { cin >> head; in(move(tail)...); }
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define TIN(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
#define VIND(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem,--_elem
#define OUT(x) cout << (x);
#define OUTL(x) cout << (x) << endl;
template<class T>bool chmax(T &a, const T &b) {if (a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if (a>b) {a=b; return 1;} return 0;}
template<class T>
string join(vector<T>& v, string delim="") { ostringstream os; rep(i,v.size())i?os<<delim<<v[i]:os<<v[0]; return os.str(); }
#pragma endregion RegionDefs

void solve()
{
    TIN(string, s);
    ll ans = 0;
    rep(i, 9) {
        if (s[i] == 'Z' && s[i+1] == 'O' && s[i+2] == 'N' && s[i+3] == 'e') ++ans;
    }
    OUTL(ans);
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <numeric>

#define ll long long int
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define drep(i, n) for(ll i = ((ll)(n) - 1); i >= 0; i--)
#define frep(i, m, n) for(ll i = (ll)(m); i < (ll)(n); i++)
#define vall(v) (v).begin(),(v).end()
#define mod 1000000007
#define inf 9223372036854775800

using namespace std;

//////////////////////////////////////////////////
//////////////////////////////////////////////////
//////////////////////////////////////////////////
int main() {

    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n){
        cin >> a[i];
    }

    vector<ll> m(n,0);
    ll ma = 0;
    rep(i,n){
        ma = max(ma,a[i]);
        m[i] = ma;
    }
    vector<ll> s(n,0);
    s[0] = a[0];
    frep(i,1,n){
        s[i] = s[i-1] + a[i];
    }
    frep(i,1,n){
        s[i] += s[i-1];
    }

    // ll k = 0;
    rep(i,n){
        ll x = 0;
        x = s[i] + (i+1) * m[i];
        cout << x << endl;
    }




    return 0;
}
//////////////////////////////////////////////////




