/*
        @uthor: Kashish Gilhotra
        user: CodeChef, CodeForces, HackerEarth, HackerRank, SPOJ: kashish001
*/

#include <bits/stdc++.h>
using namespace std;
  
#define int long long int 
typedef vector<int> vi;
typedef vector<pair<int, int>> vpi;
typedef vector<vi> vvi;
const int mod = 1e9 + 7; 

#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define debug(...) cerr << "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " 
#define EB emplace_back
#define ALL(v) v.begin(), v.end() 
#define size(v) (int)v.size() 
#define endl '\n'
#define UMO unordered_map
#define USO unordered_set
#define TC int t; cin >> t; while (t--) 

void Panda() {
    int n;
    cin >> n;
    int m = 0, maxx = INT64_MIN;
    double euc = 0;
    for(int i = 0, x;i < n ; i++) {
        cin >> x;
        m += abs(x);
        euc += (int)pow(abs(x), 2);
        maxx = max(maxx, abs(x));
    }
    cout << m << endl;
    cout << fixed << setprecision(15) << sqrt(euc) << endl;
    cout << maxx << endl;
}
  
int32_t main() {
 
    FAST;

    //freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout); 
    
    Panda();

    return 0; 
} 
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define forf(i,a,b) for(ll i = a; i < b; i++)
#define forb(i,a,b) for(ll i = b; i >= a; i--)
#define pb push_back
#define ff first
#define ss second
#define pi 3.141592653589793
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define print(v) for(auto x:v) {cout<<x<<" ";}
#define mp make_pair
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>

int main()
{
	
	#ifndef ONLINE_JUDGE 
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	fast
	ll n;
	cin>>n;
	map<ll,ll> count;
	forf(i,0,n)
	{
		ll x;
		cin >> x;
		count[x]++;
	}
	ll c = 0;
	ll ans = 0;
	for(auto x : count)
	{
		c += x.second;
		ans += x.second * (n-c);
	}
	cout<<ans;
	return 0;
}