#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int maxx = -1;
  int data;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &data);
    maxx = max(maxx, data);
  }
  printf("%d\n", data ^ maxx);
  return 0;
}
