X, Y, Z = map(int, input().split()) p = min(X, Y) p += min(abs(X-Y), Z) print(p)