#include <bits/stdc++.h>

#define MN 1001000

using namespace std;
typedef long long ll;

ll t, n, a[MN], med;
//char s[MN]; string str;
double ans;

int main() {
    scanf("%lld", &n);

    for(int i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
        ans += a[i] / 2.0;
    }
    sort(a, a + n);
    med = a[n/2];
    for(int i = 0; i < n; i++) {
        ans += abs(a[i] - med) / 2.0;
    }

    printf("%.9f\n", ans / n);
    return 0;
}

#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <iostream>
#include <fstream>
#include <chrono>

using namespace std;

void solve(int test, std::istream &in) {
    int64_t n;
    in >> n;
    int64_t n0 = n;
    vector<int64_t> f(2, 1);
    while (f.back() < n)
        f.push_back(f.back() + f[f.size() - 2]);
    vector<int> num;
    int idx = f.size() - 1;
    while (n > 0) {
        while (f[idx] > n)
            idx--;
        n -= f[idx];
        num.push_back(idx);
    }
    vector<int> op;
    idx = 0;
    int plus = 0, wait = 0, nextPlus = (num[0] + 1) & 1;
    int64_t x[2] = { 0, 0 };
    while (x[0] != n0) {
        if (wait > 0) {
            plus++;
            op.push_back(3 + nextPlus);
            x[nextPlus] += x[1 - nextPlus];
            nextPlus = 1 - nextPlus;
            wait--;
        }
        else {
            op.push_back(1 + 1 - nextPlus);
            x[1 - nextPlus]++;
            idx++;
            if (idx >= num.size()) {
                wait = num[0];
            }
            else {
                wait = num[idx - 1] - num[idx];
            }
        }
    }
    printf("%d\n", (int)op.size());
    for (int i = 0; i < op.size(); i++)
        printf("%d\n", op[i]);
    //printf("x = %lld, y = %lld\n", x[0], x[1]);
}

int main(int argc, char *argv[]) {
#ifdef VLAD_LOCAL
    ifstream in("in.txt");
    auto start = std::chrono::steady_clock::now();
#else
    istream &in = cin;
#endif
    solve(0, in);
#ifdef VLAD_LOCAL
    auto end = std::chrono::steady_clock::now();
    double seconds = (double)std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() / 1000;
    printf("%.3lf seconds\n", seconds);
#endif
	return 0;
}
