import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

T RD(T)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto A = RD!ulong;
	auto B = RD!ulong;
	auto C = RD!ulong;

	auto ab = A % 2 == B % 2;
	auto bc = B % 2 == C % 2;
	ulong ans;
	if (!ab && bc) 
	{
		++B;
		++C;
		++ans;
	}
	else if (!bc && ab)
	{
		++B;
		++A;
		++ans;
	}
	ulong[] arr = [A, B, C];
	arr.sort();
	ans += (arr[2] - arr[0]) / 2;
	ans += (arr[2] - arr[1]) / 2;

	writeln(ans);
	stdout.flush();
}