#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] = a[i - 1]) a[i] = a[i + 1];
    sum += a[i];
  }
  sum /= n;
  return 0;
}
