import std.stdio, std.algorithm, std.range, std.conv, std.string, std.math;
import core.stdc.stdio;
// foreach, foreach_reverse, writeln

void main() {
	int[] a = new int[3];
	foreach (i; 0..3) {
		scanf("%d", &a[i]);
	}
	a.sort;
	int ans = 0;
	foreach (i; 0..3) {
		ans += a[2]-a[i];
	}
	if (ans%2 == 1) ans += 3;
	writeln(ans/2);
}

