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