#include <bits/stdc++.h>
using namespace std;
int main() {
  int iMax = 0, nCount, iInput, i, iAns;
  cin >> nCount;
  for (i = 1; i <= nCount; ++i) {
    cin >> iInput;
    if (iInput > iMax) iMax = iInput;
  }
  iAns = iMax ^ iInput;
  cout << iAns;
}
