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