#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	long double ed = 0;
	ll md = 0,cd = 0;
	for(int i = 0; i < n;++i){
		ll x;
		cin >> x;
		cd = max(cd,abs(x));
		md = md + abs(x);
		ed = ed + (long double)(x*x);
	}
	ed = sqrt(ed);
	cout << md << "\n";
	cout << fixed  << setprecision(15) << ed << "\n";
	cout <<  cd << "\n";
}

#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a); i<=(b); ++i)
#define ROF(i,a,b) for(int i=(a); i>=(b); --i)
#define pb push_back
#define eb emplace_back
#define SZ(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define make_unique(a) sort(all((a))), (a).erase(unique(all((a))),(a).end())
#define x first
#define y second
#define MP make_pair
#define MT make_tuple
#define debug(x) cout << #x << " = " << x << endl
#define debug2(x,y) FOR(i,1,y) cout << "##"; cout << #x << " = " << x << endl

using namespace std;

typedef long long i64;
typedef tuple<int,int,int> iii;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long double ld;

int readInt(){ int a; scanf("%d",&a); return a; }
i64 readLong(){ i64 a; scanf("%lld",&a); return a;}
void readString(char *s){ scanf(" %s",s); }

const int mod = 998244353;
int add(int a, int b){ return ((a+=b)>=mod)?a-mod:a; }
void adding(int &a, int b){ a = add(a,b); }
int mul(int a, int b){ return a*1ll*b%mod; }
int pw(int a, int b){
	int res = a, ans = 1;
	for(int i=1;i<=b;i<<=1,res=mul(res,res)){
		if(i&b) ans = mul(ans, res);
	}
	return ans;
}

int main(){
	i64 n = readLong();
	i64 ans = LLONG_MAX;
	FOR(i, 0, 59){
		ans = min(ans, i+n/(1ll<<i)+(n&((1ll<<i)-1)));
	}
	printf("%lld",ans);
	return 0;
}
// 1
