DO YOU EXPECT ME TO FIND THIS OUT?

WHAT BASE AND/XOR LANGUAGE INCLUDES string?

DON'T BYTE OF MORE THAN YOU CAN CHEW

YOU CAN ONLY DISTORT THE LARGEST OF MATHEMATICS SO FAR

SAYING "ABRACADABRA" WITHOUT A MAGIC AND WON'T DO YOU ANY GOOD

THE LAST STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!

I HAVE NO ARRAY AND I MUST SCREAM

ELEMENTS MAY NOT BE STORED IN WEST HYPERSPACE

Input

The first line of input data contains a single integer n (1 ≤ n ≤ 10).

The second line of input data contains n space-separated integers ai (1 ≤ ai ≤ 11).

Output

Output a single integer.

Example

Input

4
2 5 3 1


Output

4
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
const double PI = acos(-1.0);
const long long mod = 1000000007;
const long long INF = 1e9;
const long long LINF = 1e18;
const long long MAXN = 1e5 + 1;
const double EPS = 1e-9;
bool check(string s) {
  for (long long i = (0); i < ((int)((s).size()) / 2); ++i)
    if (s[i] != s[(int)((s).size()) - 1 - i]) return 0;
  return 1;
}
void fake_next(string& s) {
  int h = 10 * (s[0] - '0') + s[1] - '0';
  int m = 10 * (s[3] - '0') + s[4] - '0';
  if (m < 59)
    ++m;
  else {
    m = 0;
    ++h;
    if (h == 24) h = 0;
  }
  string t = to_string(h);
  if ((int)((t).size()) < 2) t = '0' + t;
  t += ':';
  s = to_string(m);
  if ((int)((s).size()) < 2) s = '0' + s;
  s = t + s;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long i = (0); i < (n); ++i) cin >> a[i];
  int ans = a[0];
  for (long long i = (1); i < (n); ++i) ans = max(ans, a[i]);
  ans ^= a[n - 1];
  cout << ans;
  return 0;
}
