x,y,z = map(int,input().split()) if z >= y: z -= 2 elif z >= x: z -= 1 print(z)