public static void main(String[] args) throws Exception
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(reader.readLine());
        int b = Integer.parseInt(reader.readLine());
        int c = Integer.parseInt(reader.readLine());
        int d = Integer.parseInt(reader.readLine());


        if (a > b){
            if (a > c){
                if (a > d){
                    System.out.println(a);
                } else {
                    System.out.println(d);
                }
            } else if (c > d){
                System.out.println(c);
            }else {
                System.out.println(d);
            }
        } else if (b > c){
            if (b > d){
                System.out.println(b);
            }else {
                System.out.println(d);
            }

        } else if (c > d){
            System.out.println(c);
        } else {
            System.out.println(d);
        }

    }