#include <iostream>
using namespace std;//反正也就4位数求最大数,对于我们新人。我们不妨使用交换排序,下面就是accode,如果看不明白的话,建议在草稿纸上模拟一下,感兴趣的话可以去网上学习下冒泡排序,
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a>b){
        int temp = a;
        a = b;
        b = temp;
    }
    if(a>c){
        int temp = a;
        a = c;
        c = temp;
    }
    if(a>d){
        int temp = a;
        a = d;
        d = temp;
    }
    if(b>c){
        int temp = b;
        b = c;
        c= temp;
    }
    if(b>d){
        int temp = b;
        b = d;
        d = temp;
    }
    if(c>d){
        int temp = c;
        c= d;
        d= temp;
    }
    cout<<d;
    return 0;
}