import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines x,y,z = map(int,read().split()) answer = z if x <= z: answer -= 1 if y <= z: answer -= 1 print(answer)