#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template <class T>
inline bool chmin(T &a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}


void solve(long long N, std::vector<long long> x){
	i64 ans1 = 0, ans3 = 0;
	double ans2 = 0;
	REP (i, N) {
		i64 x_abs = abs(x.at(i));
		ans1 += x_abs;
		ans2 += x_abs * x_abs;
		ans3 = max(abs(ans3), x_abs);
	}
	cout << ans1 << endl;
	ans2 = sqrt(ans2);
	cout << fixed << setprecision(15) << ans2 << endl;
	cout << ans3 << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> x(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&x[i]);
    }
    solve(N, std::move(x));
    return 0;
}

#include<iostream>
#include<cstring>
#include<cassert>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<bitset>
#include<cstdio>
#include<algorithm>
using namespace std;
#define REP(i,x,y) for(int i=x;i<=y;i++)
#define rep(i,n) REP(i,1,n)
#define rep0(i,n) REP(i,0,n-1)
#define repG(i,x) for(int i=pos[x];~i;i=e[i].next)
#define ll long long
#define db double
const int N=4e5+7;
const int INF=1e9+7;
int n;
vector<int>E[N];
bool vis[N];
int sz[N];
bool dfs(int x,int f){
	bool d=0;
	vis[x]=1;
	sz[x]=1;
	for(int i=0;i<E[x].size();i++){
		if(vis[E[x][i]]){
			if(E[x][i]!=f)d=1;
		}
		else{
			d|=dfs(E[x][i],x);
			sz[x]+=sz[E[x][i]];
		}
	}
	return d;
}
int main(){
	scanf("%d",&n);
	rep(i,n){
		int x,y; scanf("%d%d",&x,&y);
		E[x].push_back(y);
		E[y].push_back(x);
	}
	int ans=0;
	rep(i,400000){
		if(vis[i])continue;
		if(!E[i].size())continue;
		bool q=dfs(i,0);
		ans+=(sz[i]-(!q));
	} 
	printf("%d\n",ans);
	return 0;
}
