#include<bits/stdc++.h>
using namespace std;
int main() {
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(a==b) cout<<c;
	else if(b==c) cout<<a;
	else if(a==c) cout<<b;
	else cout<<0;
	return 0;
}
#include<bits/stdc++.h>
using namespace std;

int main () {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(min(a,b),min(c,d)) << endl;
}