import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] s = in.nextLine().split(" ");
        int[] res = new int[s.length];
        for(int i = 0; i < s.length; i++){
            res[i] = Integer.parseInt(s[i]);
        }
        int minn = Integer.MAX_VALUE;
        int maxx = 0;
        for(int i = 0; i < res.length; i++){
            maxx = Math.max(maxx, res[i] - minn);
            minn = Math.min(minn, res[i]);
        }
        System.out.println(maxx);
    }
}