X, Y, Z = map(int, input().split()) if X <= Z and Y <= Z: Z -= 2 elif X <= Z or Y <= Z: Z -= 1 print(Z)