x,y,z = map(int, input().split()) cnt =0 if x <= z: cnt -= 1 if y <= z: cnt -= 1 print(cnt + z)