from fractions import gcd def solve(): N = int(input()) g = N if N % 2 else N // 2 if g == 1: print(1) else: print(g + 1) if __name__ == '__main__': solve()