#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  int n;
  cin >> n;
  int max1 = -1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    max1 = max(max1, a[i]);
  }
  int ans = max1;
  cout << (ans ^ a[n]) << endl;
  ;
  return 0;
}
