#include <bits/stdc++.h>
using namespace std;
int v[20];
int main() {
  int n, c, mx = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c;
    mx = max(mx, c);
  }
  cout << (mx ^ c);
  return 0;
}
