import std.stdio, std.string, std.algorithm, std.conv, std.range, std.array;

void main(){
  auto input = readln.chomp.split.map!(to!int).array.sort();
  writeln((input[1]-input[0])/2 + input[2]-input[1] + ((input[0]+input[1])%2==0 ? 0 : 2));
}