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