{
task: unique
lang: pascal
}
program unn;

  type
     tlist = array[0..2000002] of longint;

  var
     data : tlist;
     i:longint;
     f:text;
      n:longint;
procedure qsort(var a : tlist);

    procedure sort(l,r: longint);
      var
         i,j,x,y: longint;
      begin
         i:=l;
         j:=r;
         x:=a[(l+r) div 2];
         repeat
           while a[i]<x do
            inc(i);
           while x<a[j] do
            dec(j);
           if not(i>j) then
             begin
                y:=a[i];
                a[i]:=a[j];
                a[j]:=y;
                inc(i);
                j:=j-1;
             end;
         until i>j;
         if l<j then
           sort(l,j);
         if i<r then
           sort(i,r);
      end;


 begin
 sort (1,n);
 end;
 procedure out ( x:longint );
 begin
  assign ( f,'unique.out');
  rewrite ( f );
  writeln (f, data [x]);
  close ( f );
  halt;
 end;
 begin
  assign ( f,'unique.in');
  reset ( f );
  readln ( f, n );

  for i := 1 to n do
  readln ( f,data [ i ] );

  close ( f );
   qsort ( data );
   if data [1 ] <> data [2 ] then out(1);
   for i := 2 to n-1 do
   if( data [ i ] <> data[i-1])and ( data[i]<>data[i+1])then out(i);
   if data[n]<>data[n-1] then out ( n );

 end.
