#include <bits/stdc++.h>
using namespace std;
int n, a, maxn = 0;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    maxn = max(maxn, a);
  }
  a = maxn ^ a;
  printf("%d", a);
  return 0;
}
