DO YOU EXPECT ME TO FIND THIS OUT?

WHAT BASE AND/XOR LANGUAGE INCLUDES string?

DON'T BYTE OF MORE THAN YOU CAN CHEW

YOU CAN ONLY DISTORT THE LARGEST OF MATHEMATICS SO FAR

SAYING "ABRACADABRA" WITHOUT A MAGIC AND WON'T DO YOU ANY GOOD

THE LAST STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!

I HAVE NO ARRAY AND I MUST SCREAM

ELEMENTS MAY NOT BE STORED IN WEST HYPERSPACE

Input

The first line of input data contains a single integer n (1 ≤ n ≤ 10).

The second line of input data contains n space-separated integers ai (1 ≤ ai ≤ 11).

Output

Output a single integer.

Example

Input

4
2 5 3 1


Output

4
#include <bits/stdc++.h>
using namespace std;
namespace IStream {
const int LLL = 1 << 15;
char buffer[LLL], *SSS, *TTT;
char Get_Char() {
  if (SSS == TTT) {
    TTT = (SSS = buffer) + fread(buffer, 1, LLL, stdin);
    if (SSS == TTT) return EOF;
  }
  return *SSS++;
}
int Getint() {
  char c;
  int re = 0, f = 1;
  for (c = Get_Char(); c < '0' || c > '9'; c = Get_Char())
    if (c == '-') f = -1;
  while (c >= '0' && c <= '9')
    re = (re << 1) + (re << 3) + (c - '0'), c = Get_Char();
  return re * f;
}
}  // namespace IStream
class OStream {
 private:
  static const int LLL = 1 << 15;
  char staack[21];
  int topp;
  char buffer[LLL], *SSS;

 public:
  OStream() { SSS = buffer; }
  void Putint(int x, int flag) {
    bool fl = false;
    if (flag == 1) staack[++topp] = ' ';
    if (flag == 2) staack[++topp] = '\n';
    if (x < 0) x = -x, fl = true;
    if (!x) staack[++topp] = '0';
    while (x) staack[++topp] = x % 10 + '0', x /= 10;
    if (fl) staack[++topp] = '-';
    while (topp) {
      if (SSS == buffer + LLL - 1) {
        fwrite(buffer, 1, SSS - buffer, stdout);
        SSS = buffer;
      }
      *SSS++ = staack[topp--];
    }
  }
  ~OStream() {
    fwrite(buffer, 1, SSS - buffer, stdout);
    *SSS = 0;
  }
} os;
using namespace IStream;
int main() {
  int n = Getint(), Max = 0;
  for (int i = 1; i < n; i++) Max = max(Max, Getint());
  int t = Getint();
  cout << (max(Max, t) ^ t) << "\n";
  return 0;
}
