import java.util.Arrays;
public class D244{
public static void main(String[] args){
java.util.Scanner sc = new java.util.Scanner(System.in);
System.out.println(new Stone(sc.nextLine()).check());
}
}
class Stone{
private int[] a;
public Stone(String s){
String[] str = s.split(" ");
a = new int[str.length];
for(int i = 0 ; i < str.length; i++)
a[i] = Integer.parseInt(str[i]);
Arrays.sort(a);
}
public int check(){
int num = 0;
for(int i = 0,j = 1, k = 2;i < a.length; i += 3, j += 3, k += 3){
if(a[i] != a[j] || a[i] != a[k]){
num = a[i];
break;
}
}
return num;
}
}