x,y,z = map(int, input().split()) print(z - (x<=z) - (y<=z))