import std.stdio;
import std.algorithm;
import std.conv;
import std.math;
import std.string;

void main()
{
    uint ans = 0 - 1;
    int[] a = readln.split.to!(int[]);


    foreach (i; 0..3){
        foreach (j; 0..3) {
            foreach (k; 0..3) {
                int t_ans = 0;
                if (i == j || j == k || k == i)
                    continue;
                t_ans += abs(a[j]-a[i]);
                t_ans += abs(a[j]-a[k]);
                ans = min(ans, t_ans);
            }
        }
    }
    writeln(ans);
}
