class Problem0857: def solve(this): x, y, z = map(int,input().split()) res = z if z >= x: res -= 1 if z >= y: res -= 1 print(res) if __name__ == "__main__": problem = Problem0857() problem.solve()