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;
bool prime(unsigned long long n) {
  bool p = true;
  for (unsigned long long i = 2; i <= pow(n, 0.5); i++) {
    if (n % i == 0) {
      p = false;
      break;
    }
  }
  if (n <= 1) p = false;
  return p;
}
unsigned long long gcd(unsigned long long x, unsigned long long y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
unsigned long long lcm(unsigned long long x, unsigned long long y) {
  return x * y / gcd(x, y);
}
unsigned long long p(unsigned long long x, unsigned long long y,
                     unsigned long long p) {
  unsigned long long ans = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y % 2 == 1) ans = (ans * x) % p;
    y /= 2;
    x = (x * x) % p;
  }
  return ans;
}
unsigned long long fib(unsigned long long n) {
  unsigned long long a = 0, b = 1, c, i;
  if (n == 0) return a;
  for (i = 2; i <= n; i++) {
    c = a + b;
    a = b;
    b = c;
  }
  return b;
}
unsigned long long ceiling(unsigned long long a, unsigned long long b) {
  return (a + b - 1) / b;
}
vector<long long> sieve(long long n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  vector<long long> ans;
  for (long long p = 2; p <= n; ++p) {
    if (prime[p]) ans.push_back(p * p);
  }
  return ans;
}
string yay(int n) {
  char hexaDeciNum[100];
  int i = 0;
  if (n == 0) return "0";
  while (n != 0) {
    int temp = 0;
    temp = n % 16;
    if (temp < 10) {
      hexaDeciNum[i] = temp + 48;
      i++;
    } else {
      hexaDeciNum[i] = temp + 55;
      i++;
    }
    n = n / 16;
  }
  string s;
  for (int j = i - 1; j >= 0; j--) s += hexaDeciNum[j];
  return s;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i += 1) cin >> a[i];
  int L = a[n - 1];
  sort(a.begin(), a.end());
  int M = a[n - 1];
  printf("%d\n", L ^ M);
}
int main() { solve(); }
