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