X, Y, Z = map(int, input().split()) #X,Yは休む日、ZはZ日目 if Y == 2 and Z == 2: print(0) elif X > Z: print(Z) elif X <= Z and Y > Z: print(Z-1) elif Y <= Z: print(Z-2)