#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
inline int read() {
  char ch = getchar();
  int f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  int x = 0;
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int main() {
  int n = read(), t, maxi = 0;
  while (n--) maxi = max(maxi, t = read());
  printf("%d\n", t ^ maxi);
  return 0;
}
