#include <bits/stdc++.h>
using namespace std;
 
int main(){
    
 
    int n;
    cin >> n;
    vector<int>x(n);
    vector<long double>x2(n);
    for(int i=0;i<n;i++)cin >> x.at(i);
    for(int i=0;i<n;i++)x2.at(i)= x.at(i);
    long long ans1=0;
    for(int i=0;i<n;i++)ans1+=abs(x.at(i));
    cout << ans1 << endl;
 
    long double ans2=0;
    for(int i=0;i<n;i++)ans2+=abs(x2.at(i))*abs(x2.at(i));
    cout << fixed << setprecision(14)<< sqrt(ans2) << endl;
 
    int ans3=0;
    for(int i=0;i<n;i++)ans3=max(ans3,abs(x.at(i)));
    cout << ans3 << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define alfa "abcdefghijklmnopqrstuvwxyz"
#define pi 3.141592653589793
int main(void){
   // using t = tuple<int,int,int>;
    using p = pair<int,int>;
    int n;cin >> n;
    vector<int> a (n);
    vector<int> b (n);
    vector<int> c (n);
    for (int &i : a)cin >> i;
    for (int &i : b)cin >> i;
    for (int &i : c)cin >> i;
    vector<int> v(n);
    for (int i = 0; i < n; i++) {
        v[i]=b[c[i]-1];
    }
    vector<ll> aa (n);
    vector<ll> bb (n);
    for (int i = 0; i < n; i++) {
        aa[a[i]-1]++;
        bb[v[i]-1]++;
    }
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        sum += aa[i] * bb[i];
    }
    cout << sum << endl;
    }