A robot is standing at the origin of the infinite two-dimensional plane. Each second the robot moves exactly $1$ meter in one of the four cardinal directions: north, south, west, and east. For the first step the robot can choose any of the four directions, but then at the end of every second it has to turn 90 degrees left or right with respect to the direction it just moved in. For example, if the robot has just moved north or south, the next step it takes has to be either west or east, and vice versa.

The robot makes exactly $n$ steps from its starting position according to the rules above. How many different points can the robot arrive to at the end? The final orientation of the robot can be ignored.


-----Input-----

The only line contains a single integer $n$ ($1 \leq n \leq 1000$) — the number of steps the robot makes.


-----Output-----

Print a single integer — the number of different possible locations after exactly $n$ steps.


-----Examples-----

Input
1
Output
4
Input
2
Output
4
Input
3
Output
12


-----Note-----

In the first sample case, the robot will end up 1 meter north, south, west, or east depending on its initial direction.

In the second sample case, the robot will always end up $\sqrt{2}$ meters north-west, north-east, south-west, or south-east.

Source: codeforces | Difficulty: EASY
Tags: Dynamic programming

Mathematics


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


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


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def chkprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
n = int(inp())
if n % 2:
	out((n // 2 + 1) * (n // 2 + 2) * 2)
elif n % 4 == 0:
	out((n // 2 + 1) ** 2)
else:
	out(4 * (n // 4 + 1) ** 2)


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

def it():
	return int(input())
n = it()
dp = [0] * (n + 1)
if n & 1:
	k = 2
	j = 1
	for i in range(n + 1):
		if i & 1:
			dp[i] = k * j * 2
			k += 1
			j += 1
else:
	j = 2
	for i in range(2, n + 1):
		if i & 1 == 0:
			dp[i] = j * j
			j += 1
print(dp[n])


def Robot(n):
	dp = [0 for i in range(n + 1)]
	dp[1] = 4
	for i in range(2, n + 1):
		if i % 2 == 0:
			dp[i] = (i // 2 + 1) * (i // 2 + 1)
		else:
			dp[i] = 2 * (i // 2 + 1) * (i // 2 + 2)
	return dp[n]
n = int(input())
print(Robot(n))


n = int(input())
x = n // 2 + 1
if n % 2:
	print(2 * x * (x + 1))
else:
	print(x ** 2)


import math
from collections import deque
from sys import stdin, stdout, setrecursionlimit
from string import ascii_letters
from decimal import *
letters = ascii_letters[:26]
from collections import defaultdict
import sys
n = int(input())
stage = 1
v = 4
a = 1
ans = 4
for i in range(2, n + 1):
	if stage == 1:
		a += 1
		ans = a * a
	else:
		ans = a * a * 4 - v
		v = ans
	stage = 3 - stage
print(ans)


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def string2intlist(s):
	return list(map(int, s))

def calculate_sum(a, N):
	m = N / a
	sum = m * (m + 1) / 2
	ans = a * sum
	return ans

def series(N):
	return N * (N + 1) // 2

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def nCr(n, r):
	i = 1
	while i < r:
		n *= n - i
		i += 1
	return n // math.factorial(r)

def LCM(x, y):
	return x * y // math.gcd(x, y)

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def isprime(n):
	if n == 2 or n == 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def knapSack(W, wt, val, n):
	K = [[0 for x in range(W + 1)] for x in range(n + 1)]
	for i in range(n + 1):
		for w in range(W + 1):
			if i == 0 or w == 0:
				K[i][w] = 0
			elif wt[i - 1] <= w:
				K[i][w] = max(val[i - 1] + K[i - 1][w - wt[i - 1]], K[i - 1][w])
			else:
				K[i][w] = K[i - 1][w]
	return K[n][W]

def modularExponentiation(x, n):
	M = 10 ** 9 + 7
	if n == 0:
		return 1
	elif n % 2 == 0:
		return modularExponentiation(x * x % M, n // 2)
	else:
		return x * modularExponentiation(x * x % M, (n - 1) // 2) % M

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
n = inin()
if n % 2 == 0:
	print((n // 2 + 1) ** 2)
else:
	ans = 0
	for i in range(n + 1, 0, -2):
		ans += 2 * i
	print(ans)


import sys, math
input = sys.stdin.readline
INF = int(1000000000.0) + 7
MOD = 998244353

def solve():
	n = int(input())
	if n % 2 == 0:
		print((n // 2 + 1) ** 2)
	else:
		a = n // 2 + 1
		print(a * (a + 1) * 2)
t = 1
for i in range(1, t + 1):
	solve()


import math
n = int(input())
if n % 2 == 0:
	print((n // 2 + 1) * (n // 2 + 1))
else:
	x = math.ceil(n / 2)
	print(x * (x + 1) * 2)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
from itertools import accumulate as ac
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = 1
for _ in range(t):
	n = ip()
	ans = set()
	if n & 1 == 0:
		nn = n // 2
		for i in range(-nn, nn + 1):
			if (nn + i) % 2 == 0:
				for j in range(-nn, nn + 1):
					if (nn + j) % 2 == 0:
						tup = (i, j)
						ans.add(tup)
	else:
		n1 = n // 2
		n2 = n - n1
		for i in range(-n1, n1 + 1):
			if (n1 + i) % 2 == 0:
				for j in range(-n2, n2 + 1):
					if (n2 + j) % 2 == 0:
						tup = (i, j)
						ans.add(tup)
		for i in range(-n2, n2 + 1):
			if (n2 + i) % 2 == 0:
				for j in range(-n1, n1 + 1):
					if (n1 + j) % 2 == 0:
						tup = (i, j)
						ans.add(tup)
	ans = len(ans)
	print(ans)


n = int(input())
if n % 2 == 0:
	print(int((n / 2 + 1) ** 2))
else:
	n = (n + 1) / 2
	print(int(4 + (n - 1) * (2 * 8 + (n - 2) * 4) / 2))


n = int(input())
print(pow(n // 2 + 1, 2) if n % 2 == 0 else (n + 1) * ((n + 3) // 2))


import sys
import math
mod = 10 ** 9 + 7
LI = lambda : [int(k) for k in input().split()]
input = lambda : sys.stdin.readline().rstrip()
IN = lambda : int(input())
S = lambda : input()
r = range
n = IN()
m = n // 2
m += 1
if n % 2:
	print(2 * m * (m + 1))
else:
	print(m * m)


n = int(input())
dp = [0 for i in range(n + 1)]
dp[0] = 1
dp[1] = 4
for i in range(2, n + 1):
	if i % 2:
		dp[i] = dp[i - 2] + 2 * i + 2
	else:
		dp[i] = ((i + 2) // 2) ** 2
print(dp[n])


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


N = int(input())
if N % 2 == 0:
	ans = (1 + N / 2) * (1 + N / 2)
else:
	ans = ((N + 2) * (N + 2) - 1) / 2
print(str(ans).replace('.0', ''))


def move_n_turn(n: int):
	if n == 0:
		return 1
	if n <= 2:
		return 4
	if n == 3:
		return 12
	if n % 2 == 0:
		if n % 4 != 0:
			return ((n + 2) // 2) ** 2
		else:
			return move_n_turn(n - 4) + 2 * (n // 2 + 1) + 2 * (n // 2 - 1)
	if n % 2 == 1:
		return move_n_turn(n - 2) + 4 * ((n + 1) // 2)
n = int(input())
print(move_n_turn(n))


n = int(input())
if n == 1 or n == 2:
	print(4)
elif n == 0:
	print(1)
else:
	l = [0 for _ in range(n + 1)]
	l[0] = 1
	l[1] = 4
	l[2] = 4
	j = 2
	for i in range(3, n + 1):
		if i % 2 == 1:
			l[i] = l[i - 2] + 4 * j
		else:
			l[i] = l[i - 4] + 4 * j
			j += 1
	print(l[n])


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


lista = [0] * 1001
lista[1] = 4
lista[2] = 4
for i in range(2, 1001):
	if i % 2 == 0:
		lista[i] = (i // 2 + 1) ** 2
	else:
		lista[i] = (i + 2) ** 2 - ((i + 1) // 2 + 1) ** 2 - lista[i - 1]
print(lista[int(input())])


n = int(input())
if n % 2:
	k = n // 2
	print(2 * (k + 1) * (k + 2))
else:
	print((n // 2 + 1) ** 2)


n = int(input())
if not n & 1:
	print((n // 2 + 1) ** 2)
else:
	print(2 * (n // 2 + 1) * (n // 2 + 2))


import sys
input = sys.stdin.readline
n = int(input())
print((n + 2) ** 2 // 2 if n % 2 else (n // 2 + 1) ** 2)


from sys import *
step = int(stdin.readline())
totalStepX = round(step / 2)
totalStepY = step - totalStepX
posibleX = totalStepX + 1
posibleY = totalStepY + 1
posiblePoint = posibleX * posibleY
if step % 2 != 0:
	posiblePoint = posiblePoint * 2
print(posiblePoint)


a = int(input())
if a % 2 == 0:
	v = int(a / 2)
	print((v + 1) ** 2)
else:
	y = int(a / 2)
	z = y + 1
	print((y + 1) * (z + 1) * 2)


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


a = int(input())
if a % 2 == 1:
	print(int((a / 2 + 0.5 + 1) * (a / 2 - 0.5 + 1) * 2))
else:
	print(int((a / 2 + 1) ** 2))


t = int(input())
if t % 2 == 0:
	y = int(t / 2) + 1
	ans = int(y * y)
else:
	terms = t + 2
	lnt = int(terms / 2) + 1
	gnt = int(terms / 2)
	x = int(t / 2)
	ln = x + 1
	gn = x + 2
	ans = int(ln * lnt) + int(gn * gnt)
print(ans)


n = int(input().strip())

def lol(n):
	if n == 1:
		return 4
	return lol(n - 2) + n * 2 + 2
if n % 2 == 0:
	print(int((n / 2 + 1) ** 2))
else:
	print(lol(n))


import sys
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = 1
uu = t
while t > 0:
	t -= 1
	n = fi()
	if n % 2 == 0:
		c = 0
		for i in range(-n // 2, n // 2 + 1, 2):
			for j in range(-n // 2, n // 2 + 1, 2):
				c += 1
		print(c)
	else:
		c = 0
		for i in range(-n // 2, n // 2 + 2):
			for j in range(-n // 2, n // 2 + 2):
				if abs(i) % 2 != abs(j) % 2:
					c += 1
		print(c)


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


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = int(input())
	if n % 2 == 0:
		pow = n // 2 + 1
		print(pow ** 2)
	else:
		pow = (n + 1) // 2
		print(pow * (pow + 1) * 2)
q = 1
for i in range(q):
	solve()


n = int(input())
if n % 2:
	n //= 2
	n += 1
	print((4 + (n - 1) * 4 + 4) // 2 * n)
else:
	print((n + 2) ** 2 // 4)


n = int(input())

def odds_in_square(n):
	return 2 * n * (n + 1)

def evens_in_square(n):
	return odds_in_square(n) + 1
if n % 2:
	print(odds_in_square((n + 1) // 2))
else:
	x = n // 2
	a = [1]
	for i in range(1, x + 1):
		a.append(evens_in_square(i) - a[i - 1])
	print(a[-1])


n = int(input())

def odds_in_square(n):
	return 2 * n * (n + 1)

def evens_in_square(n):
	return odds_in_square(n) + 1
if n % 2:
	print(odds_in_square((n + 1) // 2))
else:
	print((n // 2 + 1) ** 2)


n = int(input())
if n == 0:
	print('1')
elif n == 1:
	print('4')
elif n % 2 == 0:
	a = int(n // 2)
	print((a + 1) ** 2)
else:
	a = int(n // 2)
	print(2 * (a + 1) * (a + 2))


n = int(input())
if n % 2 == 0:
	dot = 1
	line = 1
	for i in range(2, n + 1, 2):
		dot += 1
		line += 1
	print(dot * line)
else:
	dot = 1
	line = 0
	for i in range(1, n + 1, 2):
		dot += 1
		line += 1
	print(dot * line * 2)


n = int(input())
if n == 1:
	print(4)
else:
	if n % 2 == 0:
		l = n // 2
		r = n // 2
		ans = (l + 1) * (r + 1)
	else:
		l = n // 2
		r = n // 2
		ans = (l + 2) * (r + 1) + (r + 2) * (l + 1)
	print(ans)


n = int(input())
temp = 0
m = int(n / 2) + 1
if n % 2 != 1:
	temp = m * m
else:
	temp = 2 * m * (m + 1)
print(temp)


import sys
input = sys.stdin.readline
n = int(input())
n = n + 1
if n % 2 == 1:
	print(int(((n + 1) / 2) ** 2))
else:
	k = n // 2
	res = 0
	for i in range(1, k + 1):
		res = res + i
	print(int(4 * res))


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


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


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
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 read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	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))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.height = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val == 0:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
			elif val >= 1:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left

	def do(self, temp):
		if not temp:
			return 0
		ter = temp
		temp.height = self.do(ter.left) + self.do(ter.right)
		if temp.height == 0:
			temp.height += 1
		return temp.height

	def query(self, xor):
		self.temp = self.root
		cur = 0
		i = 31
		while i > -1:
			val = xor & 1 << i
			if not self.temp:
				return cur
			if val >= 1:
				self.opp = self.temp.right
				if self.temp.left:
					self.temp = self.temp.left
				else:
					return cur
			else:
				self.opp = self.temp.left
				if self.temp.right:
					self.temp = self.temp.right
				else:
					return cur
			if self.temp.height == pow(2, i):
				cur += 1 << i
				self.temp = self.opp
			i -= 1
		return cur
n = int(input())
ans = 0
t = 0
for i in range(n + 1):
	j = n - i
	if abs(i - j) <= 1:
		ans += (j + 1) * (i + 1)
print(ans)


import math
import string
import random
import sys
from random import randrange
from collections import deque
from collections import defaultdict
from bisect import bisect, bisect_right, bisect_left

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
n = int(data())
if n % 2 == 0:
	print((n // 2 + 1) ** 2)
else:
	st = 4
	dff = 8
	k = 1
	while k < n:
		st += dff
		dff += 4
		k += 2
	print(st)


def calculate(n):
	ans = 1 + (3 * n * (n + 4) + 2 - (-1) ** n * (n * (n + 4) + 2)) // 8
	return ans
for _ in range(1):
	n = int(input())
	ans = calculate(n)
	print(ans)


import math

def main_function():
	n = int(input())
	if n % 2 == 0:
		n += 1
		z = n // 2
		s = 3
		counter = 1
		for i in range(z):
			counter += s
			s += 2
	else:
		s = 8
		z = n // 2
		counter = 4
		for i in range(z):
			counter += s
			s += 4
	print(counter)
main_function()


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


n = int(input())
while True:
	if n % 4 == 0:
		even_bit = n // 2
		num_steps_x = even_bit + 1
		num_steps_y = even_bit + 1
		num_steps = num_steps_x * num_steps_y
		print(num_steps)
		break
	elif n % 4 == 1:
		even_bit = n // 2
		num_steps_even = even_bit + 1
		odd_bit = n // 2 + 1
		num_steps_odd = odd_bit + 1
		num_steps = num_steps_even * num_steps_odd * 2
		print(num_steps)
		break
	elif n % 4 == 3:
		even_bit = n // 2
		num_steps_even = even_bit + 1
		odd_bit = n // 2 + 1
		num_steps_odd = odd_bit + 1
		num_steps = num_steps_even * num_steps_odd * 2
		print(num_steps)
		break
	else:
		odd_bit = n // 2
		num_steps_odd = odd_bit + 1
		num_steps = num_steps_odd ** 2
		print(num_steps)
		break


from sys import stdin
for _ in range(1):
	n = int(input())
	if n % 2 == 0:
		print((int(n / 2) + 1) ** 2)
	else:
		print(2 * (int(n / 2) + 2) * (int(n / 2) + 1))


n = int(input())
s = n // 2 + 1
if n == 1:
	print(4)
elif n % 2:
	print(2 * s * (s + 1))
else:
	print(s ** 2)


try:
	n = int(input())
	holes = 1
	even_times = 1
	odd_times = 0
	for i in range(1, n + 1):
		if i % 2 == 0:
			even_times += 1
		else:
			odd_times += 1
			holes += 1
	if n % 2 == 0:
		print(even_times * holes)
	else:
		print(odd_times * holes * 2)
except exception as e:
	print(e)


n = int(input())
sq = lambda x: x * x
print(sq(n + 2) >> 1 if n & 1 else sq(n + 2 >> 1))


import sys
input = sys.stdin.readline
n = int(input())
if n & 1:
	y = n // 2
	x = y + 1
else:
	y = n // 2
	x = n // 2
k = (x + 1) * (y + 1)
if n & 1:
	k = k * 2
print(k)


n = int(input())
if n == 1:
	print(4)
elif n % 2 == 0:
	print(int(((n + 2) / 2) ** 2))
else:
	print(int((n + 2) ** 2 / 2 - 0.5))


for _ in range(1):
	n = int(input())
	l = []
	for i in range(2, 10005):
		l.append(i * i)
		l.append(i * i)
	i = 0
	kitna = 4
	while i < 1005:
		l[i + 1] = l[i] * 2 + kitna
		kitna += 2
		i += 2
	if n == 1 or n == 2:
		print(4)
	else:
		print(l[n - 2])


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


def solve(n):
	if n == 0:
		return 0
	i = 2
	j = 2
	while i < n:
		i += 2
		j += 1
	return j * j
n = int(input())
if n % 2 == 0:
	print(solve(n))
else:
	p = solve(n - 1) + solve(n + 1) - 1
	if n == 1:
		p += 1
	print(p)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(ele, end='\n')
n = L()[0]
cnt = 0
final = set()
for i in range(n + 10):
	for j in range(n + 10):
		if i + j > n:
			break
		if abs(i + j - (n - (i + j))) >= 2:
			continue
		for a in range(n + 10):
			if i + j + a > n:
				break
			b = n - i - j - a
			if abs(i + j - (b + a)) >= 2:
				continue
			final.add((i - j, a - b))
print(len(final))
endtime = time.time()


total_steps = int(input())
if total_steps % 2 == 0:
	print((total_steps // 2 + 1) ** 2)
elif total_steps == 1:
	print(4)
else:
	M = [3]
	k2 = len(M)
	for i in range(total_steps // 2):
		M.append(M[k2 - 1] - 4 * (i + 1))
		k2 = k2 + 1
	ans = total_steps ** 2 + M[total_steps // 2 - 1]
	print(ans)


n = int(input())
ans = 1 + (3 * n * (n + 4) + 2 - (-1) ** n * (n * (n + 4) + 2)) // 8
print(ans)


n = int(input())
if n == 1:
	print(4)
elif n % 2 == 0:
	even_sq = (n // 2 + 1) * (n // 2 + 1)
	print(even_sq)
else:
	odd_sq = (n // 2 + 1) * (n // 2 + 2) * 2
	print(odd_sq)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	if n % 2 == 0:
		cnt1 = 0
		for i in range(-n // 2, n // 2 + 1, 2):
			cnt1 += 1
		return cnt1 ** 2
	else:
		cnt1 = 0
		for i in range(-(n // 2 + 1), n // 2 + 2, 2):
			cnt1 += 1
		cnt2 = 0
		for i in range(-n // 2, n // 2 + 1, 2):
			cnt2 += 1
		return cnt1 * cnt2 * 2
print(solve())


innum = lambda : int(input())
inmul = lambda : map(int, input().split())
instr = lambda : str(input())
inarr = lambda : list(map(int, input().split()))

def solve():
	n = innum()
	if n % 2 == 0:
		print((n // 2 + 1) ** 2)
	else:
		k = (n - 1) // 2
		print(2 * (k + 1) * (k + 2))

def main():
	t = 1
	for _ in range(t):
		solve()
main()


import math
q = int(input())
if q % 2 == 1:
	x = math.ceil(q / 2)
	print(x * (x + 1) * 2)
if q % 2 == 0:
	print((q // 2 + 1) ** 2)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

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

def valid(row, col, rows, cols, rcross, lcross):
	return rows[row] == 0 and cols[col] == 0 and (rcross[col + row] == 0) and (lcross[col - row] == 0)

def div(n):
	tmp = []
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			cnt = 0
			while n % i == 0:
				n = n // i
				cnt += 1
			tmp.append((i, cnt))
	if n > 1:
		tmp.append((n, 1))
	return tmp

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		flag = True
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				flag = False
				break
		return flag

def s(b):
	d = defaultdict(int)
	while b > 0:
		tmp = b % 10
		if d[tmp] > 0:
			return False
		d[tmp] = 1
		b = b // 10
	return True

def main():
	n = ii()
	if n % 2:
		print(2 * (n // 2 + 1) * (n // 2 + 1 + 1))
	else:
		print((n // 2 + 1) * (n // 2 + 1))
main()


n = int(input())
dp = [0 for i in range(1001)]
dp[1] = 4
dp[2] = 4
dp[3] = 12
if n <= 3:
	print(dp[n])
else:
	if n % 2 == 0:
		s = 5
		for i in range(4, n + 1, 2):
			dp[i] = dp[i - 2] + s
			s += 2
	else:
		s = 12
		for i in range(5, n + 1, 2):
			dp[i] = dp[i - 2] + s
			s += 4
	print(dp[n])


import os
import sys
from io import BytesIO, IOBase

def solution():
	n = int(input())
	print((n % 2 + 1) * (n // 2 + 1) * (n - n // 2 + 1))
	return

def main():
	testcases = 1
	for _ in range(testcases):
		solution()
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 read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	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))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import copy
import math
n = int(input())
count1 = 0
count2 = 0
isodd = n % 2 == 1
if isodd:
	for i in range(0, n + 1):
		for j in range(-n - 1, 1):
			if abs(i) + abs(j) == n // 2:
				count1 += 1
			if abs(i) + abs(j) == n // 2 + 1:
				count2 += 1
	print(count1 * count2 * 2)
else:
	for i in range(0, n + 1):
		for j in range(-n - 1, 1):
			if abs(i) + abs(j) == n // 2:
				count1 += 1
	print(count1 * count1)


n = int(input())
if n == 1:
	print(4)
elif n % 2 == 0:
	print(pow(n // 2 + 1, 2))
else:
	print(2 * ((n + 1) // 2) * ((n + 1) // 2 + 1))


import sys
input = sys.stdin.readline
x = int(input())
print(2 * (x // 2 + 1) * (x // 2 + 2) if x % 2 else (x // 2 + 1) * (x // 2 + 1))


t = int(input())
o = 0
k = x = t // 4
if t % 4 == 0:
	o = (2 * x + 1) ** 2
if t % 4 == 1:
	x += 1
	o = 8 * x * x - 4 * x
if t % 4 == 2:
	x += 1
	o = 4 * x * x
if t % 4 == 3:
	k += 1
	o = 8 * k * k + 4 * k
print(o)


from io import BytesIO, IOBase
import sys
import math
import os
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 read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	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))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def main():
	n = int(input())
	max_in = math.ceil(n / 2)
	max_against = math.floor(n / 2)
	total_x_endings = 2 * math.ceil(max_in / 2) + (max_in % 2 == 0)
	total_y_endings = 2 * math.ceil(max_against / 2) + (max_against % 2 == 0)
	ans = total_x_endings * total_y_endings
	if n % 2 == 0:
		print(ans)
		return
	print(2 * ans)
main()


move_steps = int(input())
if move_steps % 2 == 0:
	step_x = move_steps / 2
	step_y = move_steps / 2
	print(int((step_x + 1) * (step_y + 1)))
else:
	step_x = (move_steps + 1) / 2
	step_y = (move_steps - 1) / 2
	print(2 * int((step_x + 1) * (step_y + 1)))


def recurse(x, y, lastmoved, n):
	if n == 0:
		dest = str(x) + str(y)
		finalPoints[dest] = True
		return 0
	if lastmoved == 'x':
		desiredKey = str(x) + str(y) + str(n) + lastmoved
		if dp.get(desiredKey):
			return 0
		else:
			recurse(x, y + 1, 'y', n - 1)
			recurse(x, y - 1, 'y', n - 1)
			dp[desiredKey] = True
			return 0
	else:
		desiredKey = str(x) + str(y) + str(n) + lastmoved
		if dp.get(desiredKey):
			return 0
		else:
			recurse(x + 1, y, 'x', n - 1)
			recurse(x - 1, y, 'x', n - 1)
			dp[desiredKey] = True
			return 0
n = int(input())
dp = {}
finalPoints = {}
if n % 2 == 0:
	n = n // 2
	print((n - 1) * (n + 3) + 4)
else:
	n = n // 2 + 1
	print(2 * n * (n + 1))


n = int(input())
ans = 0
if n % 2:
	for i in range(1, n + 1, 2):
		ans += i
	ans += (n + 1) // 2
	ans *= 2
else:
	ans = (n // 2 + 1) ** 2
print(ans)


n = int(input())
x = n // 2 + 1
print([x ** 2, 2 * x * (x + 1)][n % 2])


n = int(input())
if n % 2 == 0:
	print((n // 2 + 1) ** 2)
else:
	count = 0
	increament = 4
	i = 1
	for i in range(1, n + 2, 2):
		count = count + increament
		increament = increament + 4
	print(count)


from sys import stdin, stdout
import math
from collections import defaultdict
ans = []
n = int(stdin.readline())
if not n % 2:
	k = n / 2
	print(int((k + 1) ** 2))
else:
	k = math.floor(n / 2)
	print(2 * (k + 1) * (k + 2))


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


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
n = int(input())
ans = [4, 4, 12, 9]
if n <= 4:
	print(ans[n - 1])
else:
	for i in range(4, n):
		toPlus = (i // 2 + 1) * 4
		if i % 2 == 0:
			ans.append(ans[i - 2] + toPlus)
		else:
			ans.append(ans[i - 4] + toPlus)
	print(ans[-1])


import random
import math
from collections import defaultdict
import itertools
from sys import stdin, stdout
import sys
import operator

def main():
	z = ''
	d = defaultdict()
	t = 1
	n = int(input())
	p = (n + 1) // 2
	if n % 2 == 0:
		print((n // 2 + 1) ** 2)
	else:
		rn = (n - 1) // 2 + 1
		cn = (n + 1) // 2 + 1
		print(2 * rn * cn)
main()


def move(no):
	arr1 = [0] * 1001
	for i in range(1, 1001):
		if i % 2 != 0:
			arr1[i] = (i + 1) * 2
		else:
			arr1[i] = i * 2
	arr2 = [0] * 1001
	arr2[3] = 4
	arr2[4] = 1
	for i in range(6, 1001, 2):
		scratch = arr1[i - 4] + arr2[i - 4]
		arr2[i] = scratch
	for i in range(5, 1001, 2):
		scratch = arr1[i - 2] + arr2[i - 2]
		arr2[i] = scratch
	result = arr1[no] + arr2[no]
	print(result)
no = int(input())
move(no)


n = int(input())
pre = 4
if n % 2 != 0:
	g = 2
	i = 3
	while i <= n:
		pre = pre + 4 * g
		g += 1
		i = i + 2
	print(pre)
else:
	ans = n // 2 + 1
	print(ans * ans)


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


n = int(input())
if n % 2:
	nn = n // 2 + 1
	print(nn * (nn + 1) * 2)
else:
	print((n // 2 + 1) ** 2)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = iinput()
if n % 2 == 0:
	print((n // 2 + 1) ** 2)
else:
	print((n + 1) * ((n + 3) // 2))


n = int(input())
if n % 2 == 0:
	print(pow(n // 2 + 1, 2))
else:
	k = n // 2
	print(2 * (k + 1) * (k + 2))


n = int(input())
print((3 * n * (n + 4) - (-1) ** n * (n * (n + 4) + 2) + 10) // 8)


import sys
from collections import deque
input = sys.stdin.readline

def i():
	return input().rstrip()

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

def mii():
	return map(int, input().rstrip().split())

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


def test(n: int):
	if n % 2 == 1:
		x = int((n + 1) / 2)
		return 2 * x * (x + 1)
	else:
		x = int(n / 2) + 1
		return x * x
n = int(input())
print(test(n))


from sys import stdin, stdout
import math
R = lambda : stdin.readline().strip()
RL = lambda f=None: list(map(f, R().split(' '))) if f else list(R().split(' '))
output = lambda x: stdout.write(str(x) + '\n')
output_list = lambda x: output(' '.join(map(str, x)))
n = int(R())
if n % 2:
	output(2 * (n // 2 + 1) * (n - n // 2 + 1))
else:
	output((n // 2 + 1) * (n - n // 2 + 1))


n = int(input())
(x, y) = [1, 1]
for i in range(n):
	x += 1 if i % 2 == 0 else 0
	y += 1 if i % 2 == 1 else 0
print(x * y) if n % 2 == 0 else print(2 * x * y)


n = int(input())
a = 0
k = 1
if n % 2:
	for i in range(n // 2 + 1):
		a += k * 4
		k += 1
elif n % 4:
	k = 0
	for i in range(n // 4 + 1):
		a += k * 4 + 4
		k += 2
else:
	k = 1
	a = 1
	for i in range(n // 4):
		a += k * 4 + 4
		k += 2
print(a)


n = int(input())
x = (n + 3) // 2
y = (n + 2) // 2
total = x * y * (1 if x == y else 2)
print(total)


def f(n):
	if n == 1 or n == 2:
		return 4
	elif n == 3:
		return 12
	elif n == 4:
		return 9
	else:
		a = (n + n % 2) * 2
		if n % 2 == 0:
			c = 4
		else:
			c = 2
		b = a + f(n - c)
		return b
n = int(input())
print(f(n))


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).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):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def solution():
	n = int(input())
	l = [4, 4, 12, 9, 24, 16, 40, 25, 60, 36, 84, 49, 112, 64, 144, 81, 180, 100, 220, 121, 264, 144, 312, 169, 364, 196, 420, 225, 480, 256, 544, 289, 612, 324, 684, 361, 760, 400, 840, 441, 924, 484, 1012, 529, 1104, 576, 1200, 625, 1300, 676, 1404, 729, 1512]
	ans = 0
	if n % 2 == 0:
		x = 1
		for i in range(0, n >> 1):
			ans += x
			x += 1
		ans += ans + x
	else:
		x = 2
		for i in range(0, (n + 1) // 2):
			ans += x
			x += 2
		ans += ans
	print(ans)
t = 1
for _ in range(t):
	solution()


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import combinations, permutations
from bisect import *
from fractions import Fraction
from heapq import *
from random import randint

def main():
	n = int(input())
	x = n // 2
	if n % 2:
		print(2 * (x + 1) * (x + 2))
	else:
		print((x + 1) ** 2)
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 read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	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))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
ans = 4
c = 0
if n == 1 or n == 2:
	print(4)
elif n % 4 == 0:
	print(4 * (n // 4 + 1) * (n // 4 + 1) - 4 * (n // 4) - 3)
elif n % 2 != 0:
	k = n // 2
	print(2 * (k + 1) * (k + 2))
else:
	print(4 * ((n - 2) // 4 + 1) * ((n - 2) // 4 + 1))


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


from collections import deque, Counter
from collections import defaultdict as dfd
from bisect import bisect, bisect_left
from math import sqrt, gcd, ceil, factorial, log2
from heapq import heapify, heappush, heappop
MOD = 10 ** 9 + 7
inf = float('inf')
ans_ = []

def nin():
	return int(input())

def ninf():
	return int(file.readline())

def st():
	return input().strip()

def stf():
	return file.readline().strip()

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

def readf():
	return list(map(int, file.readline().strip().split()))

def readfl():
	return list(map(float, input().strip().split()))

def readffl():
	return list(map(float, file.readline().strip().split()))

def solve():
	n = nin()
	if n % 2:
		ans_.append((n // 2 + 2) * (n // 2 + 1) * 2)
	else:
		ans_.append((n // 2 + 1) ** 2)
solve()
for i in ans_:
	print(i)


from sys import stdin, stdout
from collections import *
from math import gcd, floor, ceil

def st():
	return list(stdin.readline().strip())

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

def mp():
	return map(int, stdin.readline().split())

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

def pr(n):
	return stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	n = inp()
	if n & 1:
		ans = 1 + (3 * n * n + 12 * n + 2 + n * n + 4 * n + 2) // 8
	else:
		ans = 1 + (3 * n * n + 12 * n + 2 - n * n - 4 * n - 2) // 8
	pr(ans)
for _ in range(1):
	solve()


from collections import Counter
n = int(input())
ways = Counter()
ways[0] = 1
ways[1] = 2
for i in range(2, n // 2 + 2):
	ways[i] = ways[i - 2] + 2
if n % 2 == 0:
	print(ways[n // 2] * ways[n // 2])
else:
	print(ways[n // 2 + 1] * ways[n // 2] * 2)


n = int(input())
if n & 1:
	result = 4
	factor = 8
	for i in range(1, int(n / 2) + 1):
		result = result + factor
		factor = factor + 4
else:
	result = int((n / 2 + 1) ** 2)
print(result)


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


n = int(input())
max_ups = (n + 1) // 2
max_sides = n // 2
nb_y = max_ups * 2 // 2 + 1
nb_x = max_sides * 2 // 2 + 1
if max_ups > max_sides:
	print(nb_y * nb_x * 2)
else:
	print(nb_y * nb_x)


import os
import sys
from io import BytesIO, IOBase
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 read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	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))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())

def A241496(n):
	return 1 + (3 * n * (n + 4) + 2 - (-1) ** n * (n * (n + 4) + 2)) // 8

def main():
	print(A241496(itg()))
DEBUG = 0
URL = 'https://codeforces.com/contest/1459/problem/B'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
else:
	if DEBUG != 3:
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG:
		_print = print

		def print(*args, **kwargs):
			_print(*args, **kwargs)
			sys.stdout.flush()
	main()


import math
n = int(input())
if n % 2 == 0:
	ans = list(map(lambda x: x * x, [x for x in range(1, 502)]))
	print(ans[n // 2])
else:
	ans = list(map(lambda x: 2 * (x * (x + 1)), [x for x in range(1, 501)]))
	print(ans[math.floor(n / 2)])


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


def calculate(n):
	res = 0
	if n % 2 == 1:
		for i in range(2, n + 2, 2):
			res += i
		return res * 2
	elif n % 4 == 0:
		for i in range(1, int(n / 2) + 1):
			res += i
		res *= 2
		res += n / 2 + 1
		return int(res)
	else:
		for i in range(1, int(n / 2) + 1):
			res += i
		res *= 2
		res += (n + 2) / 2
		return int(res)
print(calculate(int(input())))


import math

def solve():
	n = int(input())
	ans = [(n // 2 + 1) ** 2, (n + 2) ** 2 // 2][n & 1]
	print(int(ans))
t = 1
for i in range(t):
	solve()


from collections import defaultdict, Counter
import sys
import bisect

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

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
k = n // 2 + 1
if n & 1:
	print(2 * k * (k + 1))
else:
	print(k * k)


n = int(input())
sm = 4
if n % 2 != 0:
	sm = 4
	for (ind, i) in enumerate(range(3, n + 1, 2)):
		sm += 4 * (i - ind - 1)
else:
	cnt = 1
	for i in range(4, n + 1, 2):
		if i == n:
			sm = (n - cnt) ** 2
			break
		cnt += 1
print(sm)


import os
import sys
from io import BytesIO, IOBase
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 read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	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))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()

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

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

def N():
	return int(input())

def S():
	return input().strip()

def print_list(l):
	print(' '.join(map(str, l)))
n = N()
if n & 1 == 0:
	print(((n >> 1) + 1) ** 2)
else:
	n = (n >> 1) + 1
	print(n * (n + 1) << 1)


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


import sys
import math
import collections
import bisect
import string

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

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

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	if n % 2 == 0:
		print((n // 2 + 1) ** 2)
	else:
		print(2 * (n // 2 + 1) * (n // 2 + 2))


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


def solve(x):
	if x % 2 == 0:
		ans = (x // 2 + 1) ** 2
	else:
		ans = 2 * (x // 2 + 1) * (x // 2 + 2)
	return ans
n = int(input())
print(solve(n))


from sys import stdin, gettrace
if gettrace():

	def inputi():
		return input()
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

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


for _ in range(1):
	n = int(input())
	ans = 1 + (3 * n * (n + 4) + 2 - (-1) ** n * (n * (n + 4) + 2)) // 8
	print(ans)


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