#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,z;
cin>>a>>b>>c>>d;
z=a<b?(b>c?(b>d?b:d):(c>d?c:d)):(a>c?(a>d?a:d):(c>d?c:d));
cout<<z;
return 0;
}
/**************************************************************
Problem: 1305
User: tangkaixuan
Language: C++
Result: Accepted
Time:12 ms
Memory:2072 kb
****************************************************************/