# coding: utf-8 r, b, w = map(int, input().split()) while w > 0: if r > b: b += 1 w -= 1 else: r += 1 w -= 1 print(min(r, b))