import std.stdio;
import std.range;
import std.array;
import std.algorithm;
import std.string;
import std.conv;
import std.typecons;
import std.math;

void main(){
    int[] tasks = readln().chomp().split().map!(to!int).array();
    solve(tasks).writeln();
}

int solve(int[] tasks){
    int result;
    int[] costs = [abs(tasks[0] - tasks[1]), abs(tasks[1] - tasks[2]), abs(tasks[2] - tasks[0])];
    int maxCost = costs.sort!("a > b").array()[0];
    result = costs.sum() - maxCost;

    return result;
}