Katie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often share everything with each other and work together on some very hard problems.

Today is Shiro's birthday. She really loves pizza so she wants to invite her friends to the pizza restaurant near her house to celebrate her birthday, including her best friends Katie and Kuro.

She has ordered a very big round pizza, in order to serve her many friends. Exactly $n$ of Shiro's friends are here. That's why she has to divide the pizza into $n + 1$ slices (Shiro also needs to eat). She wants the slices to be exactly the same size and shape. If not, some of her friends will get mad and go home early, and the party will be over.

Shiro is now hungry. She wants to cut the pizza with minimum of straight cuts. A cut is a straight segment, it might have ends inside or outside the pizza. But she is too lazy to pick up the calculator.

As usual, she will ask Katie and Kuro for help. But they haven't come yet. Could you help Shiro with this problem?


-----Input-----

A single line contains one non-negative integer $n$ ($0 \le n \leq 10^{18}$) — the number of Shiro's friends. The circular pizza has to be sliced into $n + 1$ pieces.


-----Output-----

A single integer — the number of straight cuts Shiro needs.


-----Examples-----
Input
3

Output
2
Input
4

Output
5


-----Note-----

To cut the round pizza into quarters one has to make two cuts through the center with angle $90^{\circ}$ between them.

To cut the round pizza into five equal parts one has to make five cuts.

Difficulty: EASY
Tags: Mathematics
Expected Time Complexity: O(1)

Starter code:

Solutions:
n = int(input()) + 1
if n == 1:
	print(0)
elif n % 2 != 0:
	print(n)
else:
	print(n // 2)


n = int(input())
if n == 0:
	print(0)
if n % 2 == 0 and n > 0:
	print(n + 1)
if n % 2 == 1:
	print((n + 1) // 2)


a = int(input())
a = a + 1
if a % 2 == 0:
	print(a // 2)
elif a == 1 or a == 0:
	print(0)
else:
	print(a)


import decimal
D = decimal.Decimal
n = int(input()) + 1
if n == 1:
	print(0)
elif n % 2:
	print(n)
else:
	a = n // 2
	print(a)


n = int(input()) + 1
print((n // 2, n)[n % 2 and n > 1])


k = int(input())
if k == 0:
	print(0)
elif k % 2 == 0:
	print(k + 1)
else:
	print((k + 1) // 2)


f = int(input())
if f == 0:
	print(0)
elif (f + 1) % 2 == 0:
	print((f + 1) // 2)
else:
	print(f + 1)


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y
n = int(input())
if n == 0:
	print(0)
elif (n + 1) % 2:
	print(n + 1)
else:
	print((n + 1) // 2)


n = int(input()) + 1
print((n // 2, (0, n)[n > 1])[n % 2])


t = 1
while t:
	t = t - 1
	n = int(input())
	if n == 0:
		print(0)
	elif n % 2 == 1:
		print((n + 1) // 2)
	elif n % 2 == 0:
		print(n + 1)


import sys
n = int(sys.stdin.readline().strip()) + 1
if n - 1 == 0:
	print(0)
elif n % 2 == 0:
	print(n // 2)
else:
	print(n)


import math
n = int(input())
if n == 0:
	print(0)
elif (n + 1) % 2 == 0:
	print((n + 1) // 2)
else:
	print(n + 1)


N = int(input()) + 1
count = 0
if N == 1:
	count = 0
elif N % 2 == 1:
	count = N
else:
	count = N // 2 + N % 2
print(count)


friends = int(input()) + 1
if friends % 2 == 0:
	res = friends // 2
	print(res)
elif friends == 1:
	print(0)
else:
	print(friends)


def stuff(n):
	n = n + 1
	if n - 1 == 0:
		return 0
	elif n % 2 == 0:
		return n // 2
	else:
		return n
print(stuff(int(input())))


x = int(input())
print(0 if x == 0 else (x + 1) // 2 if (x + 1) % 2 == 0 else x + 1)


from math import floor
n = int(input())
if n == 0:
	print(0)
	exit()
elif n % 2 == 1:
	print((n + 1) // 2)
	exit()
else:
	print(n + 1)
	exit()


def test_1():
	import math
	from collections import Counter
	n = list(map(int, input().split(' ')))[0]
	if n == 0:
		print(int(0))
		return
	b = (n + 1) // 2 if (n + 1) % 2 == 0 else n + 1
	print(int(b))
test_1()


a = int(input())
a += 1
if a == 1:
	print(0)
	exit()
if a % 2:
	print(a)
else:
	print(a // 2)


from bisect import bisect_left, bisect_right

def tuple_input(type):
	return map(type, input().strip().split())
n = int(input())
if n == 0:
	print('0')
elif (n + 1) % 2 == 0:
	print((n + 1) // 2)
else:
	print(n + 1)


from sys import setrecursionlimit
setrecursionlimit(1000000000)
n = int(input()) + 1

def rec(n, d=True):
	if n % 2 == 0:
		return 1 + rec(n // 2, False) * (2 - int(d))
	else:
		return n - 1 * (1 - int(d))
if n == 1:
	print(0)
else:
	print(rec(n))


r = int(input())
if r == 0:
	print('0')
else:
	r = r + 1
	t = r % 2
	if t == 0:
		print(r // 2)
	else:
		print(r)


n = int(input())
if (n + 1) % 2 == 0 or n == 0:
	print((n + 1) // 2)
else:
	print(n + 1)


import math
import os
import random
import re
import sys
n = int(input())
if n == 0:
	print('0')
elif (n + 1) % 2 == 0:
	print((n + 1) // 2)
else:
	print(n + 1)


import sys
import math
import bisect
import itertools
import random

def solve(n):
	if n == 1:
		return 0
	if n % 2:
		return n
	return n // 2

def main():
	n = int(input())
	print(solve(n + 1))
main()


n = int(input())
if n == 0:
	print(0)
	exit(0)
print([n // 2 + 1, n + 1][n % 2 == 0])


import math
n = int(input())
if n == 0:
	print(0)
	exit(0)
if (n + 1) % 2:
	print(n + 1)
else:
	print((n + 1) // 2)


N = int(input()) + 1
if N == 1:
	N = 0
if N % 2 == 0:
	N //= 2
print(N)


import sys
import filecmp
import math
from decimal import *
FILE_IO = False
if FILE_IO:
	input_stream = open('input_test.txt')
	sys.stdout = open('current_output.txt', 'w')
else:
	input_stream = sys.stdin
n = Decimal(input_stream.readline())
new_n = n + 1
if new_n == 1:
	print(0)
elif new_n % 2 == 0:
	print(new_n / 2)
else:
	print(new_n)
if FILE_IO:
	assert filecmp.cmp('current_output.txt', 'expected_output.txt', shallow=False) == True


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		n += 1
		if n == 1:
			rr.append(0)
		elif n % 2 == 0:
			rr.append(n // 2)
		else:
			rr.append(n)
	return JA(rr, '\n')
print(main())


def main():
	N = int(input())
	if not N:
		cut = 0
	elif N % 2:
		cut = (N + 1) // 2
	else:
		cut = N + 1
	print(cut)
main()


n = int(input())
n = n + 1
q = 360 / n
if n == 1:
	print(0)
elif n % 2 == 0:
	print(n // 2)
else:
	print(n)


import math
while True:
	try:
		n = eval(input().strip())
		if n == 0:
			print(0)
			continue
		n += 1
		if n & 1:
			print(n)
		else:
			print(n // 2)
	except:
		break


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
n = int(input())
if n == 0:
	print(0)
elif n % 2:
	print((n + 1) // 2)
else:
	print(n + 1)


def main():
	n = int(input())
	print(n if n < 1 else n + 1 if n % 2 == 0 else (n + 1) // 2)
main()


n = int(input()) + 1
if n - 1 == 0:
	print(0)
else:
	x = 1
	ans = 0
	while x < n:
		x *= 2
		ans += 1
	if x == n:
		print((n + 1) // 2)
	elif n % 2 == 0:
		print(n // 2)
	else:
		print(n)


n = int(input()) + 1
if n == 1:
	print(0)
else:
	(div, mod) = divmod(n, 2)
	if mod:
		print(n)
	else:
		print(div)


n = int(input()) + 1

def solve1():
	i = 0
	while n != 1:
		if n % 2 == 0:
			i += 1
			n //= 2
		else:
			break
	else:
		n = 0
	print(n + i)

def solve2():
	if n == 1:
		print(0)
	elif n % 2 == 0:
		print(n // 2)
	else:
		print(n)
solve2()


kids = list(map(int, input().strip().split()))[0] + 1
slice = 0
if kids == 1:
	kids = 0
if kids % 2 == 0:
	slice = kids // 2
else:
	slice = kids
print(int(slice))


n = int(input()) + 1
if n == 1:
	print(0)
	return
if n % 2 == 0:
	print(n // 2)
else:
	print(n)


a = int(input())
if a % 2 == 0 and a != 0:
	print(a + 1)
elif a == 0:
	print(0)
else:
	print((a + 1) // 2)


n = int(input())
t = n + 1
if n == 0:
	ans = 0
elif t % 2 == 0:
	ans = t // 2
else:
	ans = t
print(ans)


n = int(input())
s = n
d = n + 1
if d % 2 == 0:
	k = d // 2
else:
	k = d
if s == 0:
	print('0')
else:
	print(k)


import os
import sys

def main():
	n = int(input())
	if n % 2 == 0 and n != 0:
		print(n + 1)
	if n % 2 != 0:
		print((n + 1) // 2)
	if n == 0:
		print(0)
main()


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input()) + 1
if N == 1:
	print(0)
elif N % 2 == 0:
	print(N // 2)
else:
	print(N)


n = int(input().strip()) + 1
if n == 1:
	print(0)
else:
	print(n // 2 if n % 2 == 0 else n)


def f(n):
	if n == 1:
		return 0
	return n // 2 if n % 2 == 0 else n
n = int(input())
print(f(n + 1))


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = 1
if debug:
	test_count = int(input())
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	n = inp()
	if n == 0:
		print(0)
	elif n % 2 == 1:
		print((n + 1) // 2)
	else:
		print(n + 1)


Input = lambda : map(int, input().split())
n = int(input()) + 1
if n == 1:
	print(0)
	exit()
if n % 2 == 0:
	print(n // 2)
else:
	print(n)


a = input()
b = int(a) + 1
if b == 1:
	print('0')
elif b % 2 == 0:
	print(b // 2)
elif b % 2 != 0:
	print(b)


n = int(input())
n += 1
if n == 1:
	print(0)
	quit(0)
if n % 2 != 0:
	print(n)
	quit(0)
else:
	print(int(n // 2))
	quit(0)
tmp = 0
ans = 0
while n % 2 == 0:
	ans += max(tmp, 1)
	n /= 2
	if tmp == 0:
		tmp = 1
	else:
		tmp *= 2
print(ans, tmp, n - 1)
if n > 1:
	ans = ans + tmp * int(n - 1)
print(ans)


number = int(input())
if number % 2 == 0 and number != 0:
	print(number + 1)
else:
	print((number + 1) // 2)


t = int(input())
if (t + 1) % 2 == 0 and t != 0:
	print((t + 1) // 2)
elif (t + 1) % 2 != 0 and t != 0:
	print(t + 1)
else:
	print('0')


def solve():
	n = int(input()) + 1
	print(n // 2 if n % 2 == 0 or n == 1 else n)
solve()


def solve(n):
	if not n:
		return n
	n += 1
	if n % 2 == 0:
		return n // 2
	return n

def main():
	n = int(input())
	print(solve(n))
main()


n = int(input())
wk1 = n + 1
if n == 0:
	print(0)
	quit()
if wk1 % 2 == 0:
	wk1 = wk1 // 2
	ans = wk1
else:
	ans = n + 1
print(ans)


import math
guests = int(input())
guests = guests + 1
if guests == 1:
	print('0')
elif guests % 2 == 0:
	print(guests // 2)
else:
	print(guests)


s = input()
first = 0
s = list(s)
lis = []
j = 0
for i in range(1, len(s) + 1):
	if s[len(s) - i] == '9':
		s[len(s) - i] = '0'
		j = j + 1
		continue
	else:
		s[len(s) - i] = str(int(s[len(s) - i]) + 1)
		break
s = ''.join(s)
if j == len(s):
	s = '1' + s
if int(s[len(s) - 1]) % 2 != 0 and s != '1':
	print(s)
if int(s[len(s) - 1]) % 2 == 0:
	for i in range(len(s)):
		first = first % 2 * 10 + int(s[i])
		lis.append(str(first // 2))
	if lis[0] == '0':
		re = ''.join(lis[1:])
	else:
		re = ''.join(lis)
	print(re)
if s == '1':
	print(0)


def cut(n):
	if n == 0:
		return 0
	if n % 2:
		return (n + 1) // 2
	else:
		return n + 1
n = int(input())
print(cut(n))


humans = int(input())
humans += 1
if humans == 1:
	cuts = 0
elif humans % 2 == 0:
	cuts = humans // 2
else:
	cuts = humans
print(cuts)


total_people = int(input()) + 1
if total_people <= 1:
	print(0)
elif total_people % 2 == 0:
	print(total_people // 2)
elif total_people % 2 == 1:
	print(total_people)


from sys import stdin, stdout
n = int(stdin.readline())
if n == 0:
	stdout.write('0')
elif (n + 1) % 2 == 0:
	result = (n + 1) // 2
	stdout.write(str(result))
else:
	result = n + 1
	stdout.write(str(result))


n = int(input())
n += 1
m = 0
if n == 1:
	print(0)
else:
	while n % 2 == 0:
		m += 1
		n = n // 2
	if m > 0:
		print(n * 2 ** (m - 1))
	else:
		print(n)


n = eval(input())
n = n + 1
if n == 1:
	print(0)
elif n % 2 == 0:
	print(n // 2)
else:
	print(n)


n = int(input())
N = n + 1
if n == 0:
	print(0)
	exit(0)
elif N % 2 == 0:
	print(N // 2)
else:
	print(N)


n = int(input())
if n == 0:
	print(n)
else:
	t = n + 1
	if t % 2 == 0:
		print(t // 2)
	else:
		print(t)


def f(num):
	if num % 2 == 0:
		print(num // 2)
	else:
		print(num)
n = int(input())
n += 1
if n == 1:
	print(0)
	exit(0)
f(n)


x = input()
y = int(x)
if y == 0:
	print(0)
elif y % 2 == 0:
	print(y + 1)
else:
	print((y + 1) // 2)


N = int(input().strip())
if N == 0:
	print(0)
elif N % 2 == 1:
	print((N + 1) // 2)
else:
	print(N + 1)


A = int(input()) + 1
print(A // 2 if A % 2 == 0 or A == 1 else A)


import sys

def solve(n):
	if n == 0:
		return 0
	pieceCount = n + 1
	return pieceCount % 2 == 0 and pieceCount // 2 or pieceCount
print(int(solve(int(sys.stdin.readline()))))


n = int(input())
ch = 'sa7a laabed thaki exemple fel 0'
if n == 0:
	print(0)
elif n % 2 == 0:
	print(n + 1)
else:
	print((n + 1) // 2)


x = int(input())
if x == 0:
	print(0)
elif x % 2 == 0:
	print(x + 1)
elif x % 2 == 1:
	print((x + 1) // 2)


def go():
	n = int(input())
	if n == 0:
		return 0
	if n % 2 == 1:
		return (n + 1) // 2
	return n + 1
print(go())


n = int(input())
peaces = n + 1
if n == 0:
	print(0)
elif n == 1:
	print(1)
elif peaces % 2 != 0:
	print(peaces)
elif peaces % 2 == 0:
	print(peaces // 2)


import sys
import io
import math
stream_enable = 0
inpstream = '\n3\n'
if stream_enable:
	sys.stdin = io.StringIO(inpstream)
	input()

def inpmap():
	return list(map(int, input().split()))
n = int(input())
print(0 if n == 0 else n // 2 + 1 if (n + 1) % 2 == 0 else n + 1)


n = int(input())
if n == 0:
	print(0)
else:
	n += 1
	if n % 2 == 0:
		p = n // 2
		print(min(p, n))
	else:
		print(n)


N = int(input())
N += 1
if N % 2 == 0 or N == 1:
	print(N // 2)
else:
	print(N)


import sys

def Solution():
	people = int(sys.stdin.readline())
	people = people + 1
	if people == 1:
		return print('0')
	elif people % 2 == 1:
		return print(people)
	else:
		print(people // 2)
Solution()


def pizza(n):
	if n == 0:
		return 0
	elif (n + 1) % 2 == 0:
		return (n + 1) // 2
	return n + 1
m = int(input())
print(pizza(m))


slices = int(input()) + 1
if slices % 2 == 0:
	print(slices // 2)
elif slices == 1:
	print(0)
else:
	print(slices)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
else:
	_str = str
	str = lambda x=b'': x if type(x) is bytes else _str(x).encode()
from math import ceil, floor, log, sqrt, factorial, pow, pi

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	n = ii()
	n += 1
	if n % 2 == 0:
		ans = n // 2
	elif n == 1:
		ans = 0
	else:
		ans = n
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		if self.buffer.tell():
			return self.buffer.read()
		return os.read(self._fd, os.fstat(self._fd).st_size)

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', b' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', b'\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip(b'\r\n')
main()


def f():
	slices = int(input()) + 1
	if slices % 2 == 1:
		if slices == 1:
			print(0)
		else:
			print(slices)
	else:
		if slices <= 0:
			print(0)
		print(slices // 2)
f()


t = int(input())
if t == 0:
	print('0')
elif t == 1:
	print('1')
elif t == 2:
	print('3')
elif t == 3:
	print('2')
elif (t + 1) % 2 == 0:
	print((t + 1) // 2)
else:
	print(t + 1)


n_slices = int(input()) + 1
if n_slices != 1:
	if n_slices % 2 == 0:
		n_slices = n_slices // 2
else:
	n_slices = 0
print(int(n_slices))


x = int(input())
if x % 2 == 0 and x != 0:
	print(x + 1)
elif x % 2 != 0 or x == 0:
	print((x + 1) // 2)


import sys
n = int(sys.stdin.read())
m = n + 1
if m == 1:
	print(0)
elif m % 2 == 0:
	print(m // 2)
else:
	print(m)


n = int(input())
n_piece = n + 1
if n_piece % 2 == 1:
	if n_piece == 1:
		print(0)
	else:
		print(n_piece)
else:
	print(n_piece // 2)


n = int(input())
ans = (n + 1) // 2
if n % 2 == 0:
	ans = n + 1
	if n == 0:
		ans = 0
print(ans)


n = int(input())
n += 1
if n % 2 == 0:
	result = n // 2
else:
	result = n
if n == 1:
	result = 0
print(result)


n = int(input())
print((n + 1) // (1 + n % 2) * bool(n))


(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, dgraphs, mod) = (lambda : sorted(zz()), {}, 10 ** 9 + 7)
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
if n == 0:
	print(0)
	exit()
if (n + 1) % 2 == 0:
	print((n + 1) // 2)
else:
	print(n + 1)


import math

def read_tuple(types=lambda x: x):
	return list(map(types, input().strip().split()))

def read_ints():
	return read_tuple(int)

def read_int():
	return read_ints()[0]
n = read_int() + 1
if n == 1:
	print(0)
elif n % 2 == 0:
	print(n // 2)
else:
	print(n)


guests = int(input())
total = guests + 1
if total % 2 == 0 or total == 1:
	print(total // 2)
else:
	print(total)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
n = get_int()
if (n + 1) % 2 == 0:
	print((n + 1) // 2)
elif n > 0:
	print(n + 1)
else:
	print(0)


TN = 1

def solution():
	n = int(input()) + 1
	if n != 1:
		print(n if n % 2 else n // 2)
	else:
		print(0)
while TN != 0:
	solution()
	TN -= 1


n = int(input()) + 1
print(0 if not n - 1 else n // 2 if not n & 1 else n)


n = int(input())
p = n + 1
if p == 1:
	print(0)
elif p % 2 == 0:
	print(p // 2)
elif p % 2 != 0:
	print(p)


n = int(input()) + 1
print(n if n % 2 and n - 1 else n // 2)


import sys
import collections
input = sys.stdin.readline

def rints():
	return map(int, input().strip().split())

def rint():
	return int(input().strip())

def rintas():
	return [int(i) for i in input().strip().split()]

def gcd(a, b):
	if a == 0:
		return b
	return gcd(a % b, a)
n = rint()
if n == 0:
	print(0)
elif (n + 1) % 2 == 0:
	print((n + 1) // 2)
else:
	print(n + 1)


from sys import stdin
n = int(stdin.readline()) + 1
if n == 1:
	print(0)
else:
	print(n // 2 if n % 2 == 0 else n)


t = int(input())
t = t + 1
if t == 1:
	print(0)
	exit()
elif t % 2 == 0:
	print(t // 2)
	exit()
else:
	print(t)


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
n = int(input())
n += 1
if n < 2:
	print(0)
elif n % 2:
	print(n)
else:
	print(n // 2)


def read_nums():
	return [int(x) for x in input().split()]

def solve(n):
	if n == 0:
		print(0)
		return
	if (n + 1) % 2 == 0:
		print((n + 1) // 2)
	else:
		print(n + 1)

def main():
	(n,) = read_nums()
	solve(n)
main()


import sys

def main():
	n = int(sys.stdin.readline())
	part = n + 1
	if part == 1:
		print(0)
	elif part % 2 == 0:
		print(part // 2)
	else:
		print(part)
main()


def solve(n):
	if n == 1:
		print(0)
	elif n % 2 == 0:
		print(n // 2)
	else:
		print(n)
n = int(input())
solve(n + 1)