#include <bits/stdc++.h>
 
// #pragma GCC optimize("O3")
#define Fast cin.tie(0), ios::sync_with_stdio(0)
#define All(x) x.begin(), x.end()
#define louisfghbvc int t; cin >> t; for(int tt = 0; tt < t; ++tt)
#define sz(x) (int)(x).size()
#define sort_unique(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()));
using namespace std;
typedef long long LL;
typedef pair<LL, LL> ii;
typedef vector<LL> vi;
 
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/**
order_of_key(k) : nums strictly smaller than k
find_by_order(k): index from 0
**/
 
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for(auto &it : v) is >> it; return is; }
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 A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
 
void dbg_out() { cerr << " end.\n"; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << H << ' '; dbg_out(T...); }
 
const int N = 3e3 + 5;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
/**
Read problem statement carefully
**/

LL dp[N][N]; // dp[i][j], number of ways i, into j pieces
LL arr[N];
LL mp[N];

void solve(int T){
    int n;
    cin >> n;

    for(int i = 1; i <= n; ++i){
        cin >> arr[i];
    }

    dp[0][0] = 1;
    // dp[i][j]: use i elements, use j blocks
    for(int k = 1; k <= n; ++k){ // block cnt
        memset(mp, 0, sizeof mp);
        LL s = 0;
        for(int i = 0; i <= n; ++i){ // element cnt
            s += arr[i];
            s %= k;
            dp[i][k] = mp[s];
            mp[s] = (mp[s] + dp[i][k-1]) % mod;
        }
    }

    LL res = 0;
    for(int k = 1; k <= n; ++k){
        res = (res + dp[n][k]) % mod;
    }

    cout << res << "\n";
}   
 
int main()
{
    Fast;
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    // louisfghbvc
        solve(1);
    return 0;
}
 
/**
Enjoy the problem.
**/
#include<bits/stdc++.h>
#define w(x)            int x; cin>>x; for(int tc=1;tc<=x;tc++)
#define trace(x) 		cerr<<#x<<": "<<x<<" "<<endl;
#define trace1(x,y)		cerr<<#x<<": "<<x<<" "<<endl;cerr<<#y<<": "<<y<<" "<<endl;
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define pb push_back
#define endl "\n"
#define mod 1000000007
#define inp(x) cin>>x;
#define f first
#define s second
#define inf 1e18

using namespace std;
void solve(int tc) {
	int n; cin >> n;
	long double a = 0, b = 0, c = -inf;
	// int a[n];
	long double ele;
	for (int i = 0; i < n; i++) {
		// cin >> a[i];
		cin >> ele;
		ele = abs(ele);
		a += abs(ele);
		b += abs(ele) * abs(ele);

		c = max(c, ele);

	}
	b = sqrt(b);
	cout << fixed << setprecision(20) << a << endl << b << endl << c << endl;
}

int32_t main() {
	FIO
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	// w(x) {
	solve(1);
	// }
	return 0;
}