import std.algorithm, std.array, std.container, std.range; import std.string, std.conv, std.bigint, std.math, std.random; import std.stdio, std.typecons; const auto max = 10 ^^ 7; void main() { auto rgb = readln.split.map!(to!int); bool calc(int i, int _) { auto a = rgb.map!(x => x - i); auto b = a.filter!(x => x > 0).map!(x => x / 2).sum; auto c = a.filter!(x => x < 0).map!(x => -x).sum; return b >= c; } auto r = iota(max + 1).map!(to!int).assumeSorted!(calc).lowerBound(0); writeln(r.back); }