x,y,z = map(int,input().split()) minus = 0 minus += 1 if z>=x else 0 minus += 1 if z>=y else 0 print(z - minus)