x,y,z = map(int,input().split()) for i in range(50)[::-1]: dx = max(0,i-x) dy = max(0,i-y) if dx+dy <= z: print(i) exit()