#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	for (auto& x : A) cin >> x;
	ll res = 0;
	map<ll, int> a;
	ll s = 0;
	++ a[0];
	for (int i = 0; i < N; ++ i) {
		if (i % 2) {
			s += A[i];
			res += a[s];
			++ a[s];
		} else {
			s -= A[i];
			res += a[s];
			++ a[s];
		}
	}
	cout << res << endl;
}

# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using lint = long long;
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 (b<a) { a=b; return 1; } return 0; }

void solve() {
    int N;
    cin >> N;
    double x[N];
    rep(i,N) cin >> x[i];

    double ans1=0, ans2=0, ans3=-1;

    cout << fixed << setprecision(20);
    rep(i,N) ans1+=abs(x[i]);
    cout << ans1 << endl;
    lint temp = 0;
    rep(i,N) temp += x[i]*x[i];
    cout << sqrt(temp) << endl;
    rep(i,N) ans3 = max(abs(x[i]), ans3);
    cout << ans3 << endl;


    // cout << ans << endl;
}
signed main() {

    solve();

    return 0;
}