Bachgold problem is very easy to formulate. Given a positive integer n represent it as a sum of maximum possible number of prime numbers. One can prove that such representation exists for any integer greater than 1.

Recall that integer k is called prime if it is greater than 1 and has exactly two positive integer divisors — 1 and k. 


-----Input-----

The only line of the input contains a single integer n (2 ≤ n ≤ 100 000).


-----Output-----

The first line of the output contains a single integer k — maximum possible number of primes in representation.

The second line should contain k primes with their sum equal to n. You can print them in any order. If there are several optimal solution, print any of them.


-----Examples-----
Input
5

Output
2
2 3

Input
6

Output
3
2 2 2

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Number theory

Implementation

Greedy algorithms


Solutions:
n = eval(input())
if n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2)):
		print(2, end=' ')
	print('')
else:
	print(n // 2)
	for i in range(int(n / 2) - 1):
		print(2, end=' ')
	print(3)


n = int(input())
print(n // 2)
while n > 3:
	n -= 2
	print(2, end=' ')
print(n)


n = int(input())
print(n // 2)
if n <= 3:
	print(n)
elif n % 2:
	print('2 ' * (n // 2 - 1) + '3')
else:
	print('2 ' * (n // 2))


n = int(input())
print(str(n // 2) + '\n' + '2 ' * (n // 2 - 1) + '23'[n % 2])


num = int(input())
NumOf2 = num // 2
printME = NumOf2
print(NumOf2)
if NumOf2 * 2 - num != 0:
	printME -= 1
for i in range(printME):
	print(2, end=' ')
if NumOf2 * 2 - num != 0:
	print(3)


n = int(input())
print(n // 2)
m = n // 2
if n % 2 == 0:
	for i in range(m - 1):
		print('2', end=' ')
	print('2 \n')
if n % 2 == 1:
	for i in range(m - 1):
		print('2 ', end='')
	print('3\n')


from math import trunc, sqrt
k = int(input())
if k == 2:
	print(1, 2, sep='\n')
elif k == 3:
	print(1, 3, sep='\n')
elif k % 2 == 0:
	print(k // 2)
	for i in range(k // 2):
		print(2, end=' ')
else:
	print(k // 2)
	for i in range(k // 2 - 1):
		print(2, end=' ')
	print(3)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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 print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), 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', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

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

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

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

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

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return abs(a // gcd(a, b) * b)

def primesbelow(N):
	correction = N % 6 > 1
	N = {0: N, 1: N - 1, 2: N + 4, 3: N + 3, 4: N + 2, 5: N + 1}[N % 6]
	sieve = [True] * (N // 3)
	sieve[0] = False
	for i in range(int(N ** 0.5) // 3 + 1):
		if sieve[i]:
			k = 3 * i + 1 | 1
			sieve[k * k // 3::2 * k] = [False] * ((N // 6 - k * k // 6 - 1) // k + 1)
			sieve[(k * k + 4 * k - 2 * k * (i % 2)) // 3::2 * k] = [False] * ((N // 6 - (k * k + 4 * k - 2 * k * (i % 2)) // 6 - 1) // k + 1)
	return [2, 3] + [3 * i + 1 | 1 for i in range(1, N // 3 - correction) if sieve[i]]
smallprimeset = set(primesbelow(100000))

def solve():
	n = int(inp())
	if n % 2 == 0:
		print(n // 2)
		print('2 ' * (n // 2))
	else:
		print(n // 2)
		print('2 ' * (n // 2 - 1) + '3')
solve()


n = int(input())
result = n // 2
result_string = '2 ' * result if n % 2 == 0 else '2 ' * (result - 1) + '3'
print(result)
print(result_string)


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


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print(' '.join(['2' for i in range(n // 2)]))
else:
	print(n // 2)
	print(' '.join(['2' for i in range(n // 2 - 1)] + ['3']))


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	s = ''
	for _ in range(int(n / 2)):
		s += '2 '
	print(s[:-1])
else:
	print(int((n - 3) / 2) + 1)
	s = ''
	for _ in range(int((n - 3) / 2)):
		s += '2 '
	s += '3 '
	print(s[:-1])


n = int(input())
if n % 2 == 0:
	k = n // 2
	print(k)
	l = [2] * k
	print(*l)
else:
	k = n // 2
	print(k)
	l = [2] * (k - 1)
	print(*l, 3)


def bachgold(n):
	print(n // 2)
	a = [2] * (n // 2)
	if n % 2:
		a[-1] += 1
	print(*a)
n = int(input())
bachgold(n)


num = int(input())
if num % 2 == 0:
	print(num // 2)
	print('2 ' * (num // 2))
else:
	print(num // 2)
	print('2 ' * (num // 2 - 1) + '3')


n = int(input())
if n % 2:
	n32 = (n - 3) // 2
	print(n32 + 1)
	print('3 ' + ' '.join(['2'] * n32))
else:
	n2 = n // 2
	print(n2)
	print(' '.join(['2'] * n2))


n = int(input())
t = ''
if n % 2 != 0:
	t = '3'
	n -= 3
print(n // 2 + len(t))
print('2 ' * (n // 2) + t)


a = int(input())
if a % 2 == 0:
	print(int(a / 2))
	b = ''
	i = 0
	while i < int(a / 2):
		b = b + '2 '
		i = i + 1
	print(b)
else:
	print(int(a / 2))
	b = ''
	i = 0
	while i < int(a / 2) - 1:
		b = b + '2 '
		i = i + 1
	b = b + '3'
	print(b)


n = int(input())
seq = []
while n > 3:
	seq += [2]
	n -= 2
seq += [n]
print(len(seq))
print(' '.join(map(str, seq)))


n = int(input())
print(n // 2)
while n > 1:
	(_, n) = (print(2 if n > 3 else n, end=' '), n - (2 if n > 3 else n))


def main():
	n = int(input())
	if n % 2 == 0:
		count = n // 2
		print(count)
		print(' '.join(['2'] * count))
	else:
		count = 1 + (n - 3) // 2
		print(count)
		print(' '.join(['3'] + ['2'] * (count - 1)))
main()


base = int(input())
q = base // 2
bachgold = [2] * q
if base % 2 == 1:
	bachgold[-1] = 3
print(q)
print(*bachgold)


n = int(input())
print(n // 2)
if n % 2 == 0:
	ans = []
	for i in range(n // 2):
		ans.append(2)
	print(*ans)
else:
	ans = []
	for i in range(n // 2 - 1):
		ans.append(2)
	ans.append(3)
	print(*ans)


a = int(input())
if a % 2 == 0:
	print(a // 2)
	for i in range(a // 2):
		print(2, end=' ')
else:
	b = a - 3
	print(b // 2 + 1)
	for i in range(b // 2):
		print(2, end=' ')
	print(3)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print(2, end=' ')
else:
	k = n // 2
	threes = 1
	n -= 3
	print(k)
	for i in range(n // 2):
		print(2, end=' ')
	print(3, end=' ')


a = int(input())
b = a // 2
c = a % 2
print(b)
i = 0
z = []
for i in range(b):
	if i < b - 1:
		z.append(2)
	elif c > 0:
		z.append(3)
	else:
		z.append(2)
for i in z:
	print(i, end=' ')


a = int(input())
m = []
if a % 2 == 1:
	b = a
	b = b - 3
	c = b / 2
	for i in range(0, int(c)):
		m.append(2)
	m.append(3)
else:
	b = a
	c = b / 2
	for r in range(0, int(c)):
		m.append(2)
print(len(m))
s = ''
for t in m:
	s = s + str(t) + ' '
print(s)


n = int(input())
print(n // 2)
ans = ''
if n % 2 == 1:
	ans = str(3) + ' '
	n -= 3
i = 2
while i <= n:
	ans += str(2) + ' '
	i += 2
print(ans)


class CodeforcesTask749ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0

	def read_input(self):
		self.n = int(input())

	def process_task(self):
		res = []
		if self.n % 2:
			res.append(3)
			res += [2] * ((self.n - 3) // 2)
		else:
			res += [2] * (self.n // 2)
		self.result = '{0}\n{1}'.format(len(res), ' '.join([str(x) for x in res]))

	def get_result(self):
		return self.result
Solution = CodeforcesTask749ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
l = []
if n % 2 == 1:
	n = n - 3
	l.append(3)
while n > 0:
	l.append(2)
	n = n - 2
print(len(l))
for i in range(len(l)):
	print(l[i], end=' ')


n = int(input())
if n % 2 == 0:
	res = [2] * (n // 2)
else:
	res = [2] * (n // 2 - 1) + [3]
print(len(res))
print(' '.join(map(str, res)))


n = int(input())
x = []
if n % 2 == 0:
	x += [2] * (n // 2)
else:
	x += [2] * ((n - 2) // 2) + [3]
print(len(x))
print(*x)


x = int(input())
if x < 4:
	print(1)
	print(x)
elif x % 2 == 0:
	print(x // 2)
	for i in range(x // 2):
		print(2, end=' ')
else:
	print(x // 2)
	for i in range(x // 2 - 1):
		print(2, end=' ')
	print(3)


x = int(input())
print(['%s' % (x // 2) + '\n' + '%s' % (x // 2 * '2 '), '%s' % (x // 2) + '\n' + '%s' % ((x // 2 - 1) * '2 ' + '3 ')][x % 2])


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


import sys, os.path
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
	sys.stdout = open('out.txt', 'w')
n = int(input())
a = int(n / 2)
if n % 2 == 0:
	print(a)
	for i in range(a):
		print(2, end=' ')
else:
	print(a)
	for i in range(a - 1):
		print(2, end=' ')
	print(3)


n = int(input())
l = []
if n % 2 == 0:
	k = n // 2
	for i in range(0, k):
		l.append('2')
else:
	k = n // 2
	for i in range(0, k - 1):
		l.append('2')
	l.append('3')
print(len(l))
print(' '.join(l))


n = int(input())
q = n // 2
s = n % 2
a = []
for i in range(q):
	a.append(2)
print(len(a))
if s == 0:
	for t in a:
		print(t, end=' ')
else:
	a.pop()
	a.append(3)
	for y in a:
		print(y, end=' ')


n = int(input())
a = n // 2
if n % 2 == 0:
	b = [2 for i in range(a)]
else:
	b = [2 for i in range(a - 1)]
	b.append(3)
print(a)
for j in b:
	print(j, end=' ')


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
elif n % 2 != 0:
	print(n // 2)
	print('2 ' * (n // 2 - 1), 3, sep='')


import math

def BuubleSort(n):
	l = []
	if n % 2 == 0:
		l = [2] * (n // 2)
		return l
	else:
		l = [2] * (n // 2 - 1)
		l.append(3)
		return l

def main():
	t = int(input())
	ans = BuubleSort(t)
	print(len(ans))
	print(*ans)
main()


n = int(input())
m = n // 2
p = n % 2
num = []
if m and p:
	num = '2 ' * (m - 1) + '3'
elif m:
	num = '2 ' * m
	num = num.strip()
print(m)
print(num)


n = int(input())
n2 = n // 2
n3 = 0
if n2 * 2 != n:
	n2 -= 1
	n3 = 1
print(n2 + n3)
print(' '.join(['2'] * n2 + ['3'] * n3))


x = int(input(''))
output = []
sum = 0
result = 0
for c in range(10000000):
	if result == x - 3:
		sum += 1
		output.append(3)
		break
	sum += 1
	result += 2
	output.append(2)
	if result == x:
		break
print(sum)
print(*output)


n = int(input())
a = [2] * (n // 2)
if n % 2:
	a[-1] = 3
print(len(a))
print(*a)


number = int(input())
if number % 2 == 0:
	print(number // 2)
	print('2 ' * int(number / 2))
else:
	print(number // 2 + number % 2 // 3)
	print('2 ' * ((number - 3) // 2) + '3')


n = int(input())
lst = list()
for i in range(n // 2):
	lst.append(str(2))
print(n // 2)
if n % 2 == 0:
	print(' '.join(lst))
else:
	lst[-1] = str(3)
	print(' '.join(lst))


n = int(input())
if n % 2 == 0:
	ls = [2] * (n // 2)
	print(n // 2)
	print(*ls)
else:
	ls = [2] * (n // 2 - 1)
	ls.append(3)
	print(n // 2)
	print(*ls)


k = int(input())
if k % 2 == 0:
	print(int(k / 2))
	string = ''
	for i in range(int(k / 2)):
		string += '2 '
	print(string[:-1])
else:
	print(int((k - 1) / 2))
	string = ''
	for i in range(int((k - 3) / 2)):
		string += '2 '
	print(string + '3')


n = int(input())
print(n // 2)
q = n % 2
print('2 ' * (n // 2 - q) + ' ' + '3 ' * q)


n = int(input())
s = n
l = []
from math import sqrt
if n > 3:
	if n % 2:
		l += [2] * (n // 2 - 1)
		s -= (n // 2 - 1) * 2
	else:
		l += [2] * (n // 2)
		s -= n // 2 * 2
	if s != 0:
		l += [3] * (s // 3)
		s -= s // 3 * 3
	print(len(l))
	print(*l)
else:
	print(1)
	print(n)


n = int(input())
if n & 1:
	if n == 3:
		print('1\n3')
	else:
		print(n // 2)
		print('{} 3'.format(' '.join(['2' for i in range(n // 2 - 1)])))
elif n == 2:
	print('1\n2')
else:
	print(n // 2)
	print(' '.join(['2' for i in range(n // 2)]))


def solve(n):
	if n < 4:
		return [n]
	elif n % 2 == 0:
		return [2] * (n // 2)
	else:
		return [3] + [2] * ((n - 3) // 2)
n = int(input())
r = solve(n)
print(len(r))
print(*r)


n = int(input())
t = 0
p = 0
if n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
else:
	n -= 3
	print(n // 2 + 1)
	print(3, '2 ' * (n // 2))


import sys
t = int(sys.stdin.read().strip())
print(t // 2, '2 ' * (t // 2 - 1) + str(2 + t % 2), sep='\n')


n = int(input())
li = []
l = 0
while n != 0:
	if n - 2 != 1:
		li.append(2)
		n -= 2
	else:
		li.append(3)
		n = n - 3
	l += 1
print(l)
for i in li:
	if i == 2:
		print(i, end=' ')
	else:
		print(i)


n = int(input())
cnt = 0
ls = []
if n % 2 == 1:
	ls.append('3 ')
	n -= 3
	cnt += 1
while n > 0:
	ls.append('2 ')
	n -= 2
	cnt += 1
print(cnt)
print(' '.join(map(str, ls)))


n = int(input())
if n % 2 == 0:
	n = n // 2
	print(n)
	print(*str(2) * n)
else:
	n = n - 3
	n = n // 2
	print(n + 1)
	print(*str(2) * n, end=' ')
	print(str(3))


n = int(input())
if n == 3:
	print(1)
	print(3)
else:
	t = []
	if n % 2 == 0:
		print(int(n / 2))
		for i in range(int(n / 2)):
			t.append(2)
		print(*t, sep=' ')
	else:
		print(int(n / 2))
		for i in range(int(n / 2) - 1):
			t.append(2)
		t.append(3)
		print(*t, sep=' ')


x = int(input())
win = ''
z = x // 2
y = 0
if x % 2 == 0:
	print(z)
	print(z * '2 ')
else:
	print(z)
	print((z - 1) * ('2' + ' ') + '3')


n = int(input())
final = ''
if n % 2 == 0:
	for i in range(int(n / 2)):
		final = final + ' ' + '2'
else:
	for i in range(int((n - 3) / 2)):
		final = final + ' ' + '2'
	final = final + ' 3'
print(int((len(final) + 1) / 2))
print(final[1:])


def main():
	num = int(input())
	first = int(num / 2) - 1
	nums = [2] * first
	resi = num - first * 2
	if resi - 2 > 0:
		nums.append(3)
	else:
		nums.append(2)
	print(len(nums))
	for i in nums:
		print(i, end=' ')
main()


def solve(n):
	if n & 1:
		n -= 3
		print(n // 2 + 1)
		print(3, end=' ')
		while n > 0:
			print(2, end=' ')
			n -= 2
	else:
		print(n // 2)
		while n > 0:
			print(2, end=' ')
			n -= 2
n = int(input())
solve(n)


def process(n):
	if n == 2:
		print(1)
		print(2)
		return
	x = n % 2
	y = n // 2
	if x == 0:
		print(x + y)
	else:
		print(x + y - 1)
	if x == 0:
		for i in range(0, y):
			print(2, end=' ')
		return
	else:
		for i in range(0, y - 1):
			print(2, end=' ')
	for i in range(0, x):
		print(3, end=' ')

def main():
	t = int(input())
	process(t)
main()


n = int(input())
if n == 2:
	print('1\n2')
else:
	l = []
	while n != 3 and n:
		l.append(2)
		n -= 2
	if n == 3:
		l.append(3)
	print(len(l))
	for i in l:
		print(i, end=' ')
	print()


n = int(input())
res = []
if n % 2 == 1:
	res = ['2' for i in range(n // 2 - 1)]
	res.append('3')
else:
	res = ['2' for i in range(n // 2)]
print(len(res))
print(' '.join(res))


from math import log
a = int(input())
b = a / 2
c = 0
print(int(b))
if b != int(b):
	b = b - 1
	c = 1
b = int(b)
for i in range(b):
	print(2, end=' ')
if c == 1:
	print(3)


i = int(input())
rest = i % 2
n_2 = i // 2 - rest
print(rest + n_2)
print(' '.join(['2'] * n_2 + ['3'] * rest))


nr = int(input())
(prime_nrs, nrs) = (0, [])
while nr > 3:
	nr -= 2
	prime_nrs += 1
	nrs.append(2)
nrs.append(nr)
print(prime_nrs + 1)
print(' '.join([str(x) for x in nrs]))


n = int(input())
c = []
a = n // 2
if n % 2 == 0:
	for i in range(a):
		c += [2]
else:
	for i in range(a - 1):
		c += [2]
	c += [3]
print(len(c))
for i in c:
	print(i, end=' ')


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


n = int(input())
if n % 2 == 0:
	digit = n / 2
	print(int(digit))
	for i in range(0, int(digit)):
		print('2', end=' ')
else:
	d = n / 2
	print(int(d))
	for i in range(1, int(d)):
		print('2', end=' ')
	print('3')


n = int(input())
if n % 2 == 0:
	ans = [2] * int(n / 2)
	print(len(ans))
	print(*ans)
else:
	ans = [2] * int(n / 2 - 1) + [3]
	print(len(ans))
	print(*ans)


n = int(input())
print(n // 2, '\n', '2 ' * (n // 2 - 1), 2 + n % 2)


n = int(input())
a = []
if n % 2 == 0:
	for i in range(n // 2):
		a.append(2)
	print(len(a), '\n', ' '.join((str(i) for i in a)))
else:
	for i in range(n // 2 - 1):
		a.append(2)
	print(len(a) + 1, '\n', ' '.join((str(i) for i in a)), 3)


n = int(input())
if n % 2 == 0:
	con = True
	cnt = n // 2
else:
	con = False
	n -= 3
	cnt = n // 2
	cnt += 1
print(cnt)
if not con:
	lst = [2] * (cnt - 1) + [3]
	for num in lst:
		print(num, end=' ')
else:
	lst = [2] * cnt
	for num in lst:
		print(num, end=' ')


def main():
	_sum = int(input())
	times = int(_sum / 2)
	_sum -= times * 2
	print(times)
	print('2 ' * (times - 1) + ('3' if _sum else '2'))
main()


a = int(input())
if a % 2 == 0:
	print(str(int(a / 2)) + '\n' + str(int(a / 2 - 1) * '2 ' + '2'))
else:
	print(str(int(a // 2)) + '\n' + str(int(a / 2 - 1) * '2 ' + '3'))


n = int(input())
s = n
l = []
from math import sqrt
if n > 3:
	if n % 2:
		l += [2] * (n // 2 - 1)
		s -= (n // 2 - 1) * 2
	else:
		l += [2] * (n // 2)
		s -= n // 2 * 2
	if s != 0:
		l += [3] * (s // 3)
		s -= s // 3 * 3
		if s != 0:
			i = 5
			while s != 0 and i < sqrt(n) + 1:
				l += [i] * (s // i)
				s -= s // i * i
				if s != 0:
					l += [i + 2] * (s // (i + 2))
					s -= s // (i + 2)
				i += 6
	print(len(l))
	print(*l)
else:
	print(1)
	print(n)


n = int(input())
total = 0
twos = n // 2
if twos * 2 == n:
	print(twos)
	for i in range(twos):
		print('2', end=' ')
else:
	twos -= 1
	print(twos + 1)
	for i in range(twos):
		print('2', end=' ')
	print('3', end=' ')


n = int(input())
l = list()
if n % 2 == 1:
	n -= 3
	l.append(3)
for i in range(n // 2):
	l.append(2)
print(len(l))
print(' '.join(map(str, l)))


def main():
	n = int(input())
	c2 = n // 2
	if n % 2 == 0:
		c3 = 0
	else:
		c2 = c2 - 1
		c3 = 1
	result = ' '.join(['2' for v in range(c2)]) + ' ' + ' '.join(['3' for v in range(c3)])
	print(c2 + c3)
	print(result.strip())
main()


a = int(input())
if a % 2 == 1:
	kol2 = a // 2 - 1
	kol3 = 1
else:
	kol2 = a // 2
	kol3 = 0
print(kol2 + kol3)
for i in range(1, kol2 + 1):
	print('2', end=' ')
if kol3 == 1:
	print('3')


n = int(input())
p = n
if n % 2 == 0:
	s = p // 2
	q = ''
	for i in range(0, s):
		q = q + '2' + ' '
	print(s)
else:
	t = 0
	s = p // 2
	q = ''
	for i in range(0, s - 1):
		t = t + 1
		q = q + '2' + ' '
	q = q + '3' + ' '
	print(t + 1)
print(q[:-1])


n = int(input())
if n % 2 == 0:
	k = int(n / 2)
	print(k)
	s = '2 ' * k
	print(s[:-1])
else:
	k = int((n - 1) / 2)
	print(k)
	print('2 ' * (k - 1) + '3')


n = int(input())
count = 0
if n % 2 == 0:
	data = ''
	while n != 0:
		data += str(2) + ' '
		count += 1
		n -= 2
else:
	data = ''
	k = 0
	while k != n:
		if n - 3 == k:
			count += 1
			data += str(3)
			k += 3
		else:
			count += 1
			data += str(2) + ' '
			k += 2
print(count)
print(data)


number = int(input())
print(number // 2, '2 ' * (number // 2) if number % 2 == 0 else '2 ' * (number // 2 - 1) + '3', sep='\n')


n = int(input())
print(str(int(n / 2)))
while n >= 2:
	if n == 2:
		n = 0
		print('2')
	elif n == 3:
		n = 0
		print('3')
	else:
		n -= 2
		print('2 ')


n = int(input())
output = 0
primes = ''
if n % 2 == 1:
	n -= 3
	output += 1
	primes += '3 '
output += n // 2
for i in range(n // 2):
	primes += '2 '
print(output)
print(primes)


x = int(input())
if x % 2 == 0:
	print(x // 2)
	y = x // 2
	print('2 ' * y)
else:
	v = x - 3
	n = v // 2
	print(n + 1)
	print('2 ' * n + '3')


n = eval(input())
ans = 0
flag = False
if n & 1:
	ans = -1
	flag = True
ans += (n + 1) // 2
print(ans)
for i in range(1, ans):
	print(2, end=' ')
if flag:
	print(3)
else:
	print(2)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	for j in range(n // 2):
		print('2', end=' ')
else:
	print(n // 2)
	for j in range(n // 2 - 1):
		print('2', end=' ')
	print('3', end=' ')


n = int(input())
s = '2 ' * (n // 2 - 1)
if n % 2 == 0:
	s += '2'
else:
	s += '3'
print(n // 2)
print(s.strip())


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


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


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
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 [int(x) for x in sys.stdin.readline().split()]

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 main():
	n = I()
	a = []
	if n % 2 == 1:
		a.append(3)
		n -= 3
	a += [2] * (n // 2)
	return '{}\n{}'.format(len(a), ' '.join(map(str, a)))
print(main())


n = int(input())
count = n // 2
print(count)
if n % 2 == 0:
	print(' '.join(['2'] * count))
else:
	print(' '.join(['2'] * (count - 1)), end=' ')
	print('3')


n = int(input())
k = n // 2
p = [2 for x in range(k)]
p[0] += n % 2
print(k)
print(' '.join(map(str, p)))


def codeforces(n):
	if n == 2 or n == 3:
		amount = 1
		numbers = (str(n),)
	else:
		amount = n // 2
		if n % 2 == 0:
			numbers = ('2',) * amount
		else:
			numbers = ('2',) * (amount - 1) + ('3',)
	return (amount, numbers)
n = int(input())
(amount, numbers) = codeforces(n)
print(amount)
print(' '.join(numbers))


n = int(input())
x = n // 2
r = n % 2
l1 = []
for i in range(x - r):
	l1.append(2)
for i in range(r):
	l1.append(3)
print(len(l1))
for i in l1:
	print(i, end=' ')


n = int(input())
(a, b) = (n // 2 if n % 2 == 0 else (n - 3) // 2, n % 2)
print(a + b)
print(*[2] * a + [3] * b)


t = int(input())
s = ''
if t % 2 == 0:
	n = t / 2
	n = int(n)
	for x in range(n):
		s += '2 '
	print(n)
	print(s)
else:
	a = t // 2 - 1
	a = int(a)
	b = t - a * 2
	b = str(b)
	for x in range(a):
		s += '2 '
	s += b
	print(a + 1)
	print(s)


import math

def find2s(n):
	st = ''
	while n != 0:
		st = st + '2' + ' '
		n = n - 2
	return st
x = int(input())
ans = ''
if x % 2 == 0:
	ans = find2s(x)
	print(math.floor(x / 2))
	print(ans)
else:
	ans = find2s(x - 3)
	ans = ans + '3'
	print(math.floor((x - 3) / 2) + 1)
	print(ans)


n = int(input())
if n % 2 == 0:
	k = ['2'] * (n // 2)
else:
	k = ['2'] * (n // 2 - 1)
	k.append('3')
print(len(k))
print(' '.join(k))


n = input()
n = int(n)
f = ''
if n % 2 == 1:
	f = f + '3 '
	k = (n - 3) // 2
	print(k + 1)
else:
	k = n // 2
	print(k)
while k > 0:
	f = f + '2 '
	k = k - 1
print(f)


from sys import stdout
n = int(input())
if n % 2:
	n = (n - 3) // 2
	print(n + 1)
	stdout.write('3 ')
else:
	n = n // 2
	print(n)
stdout.write(' '.join(['2'] * n) + '\n')


def main():
	n = int(input())
	r = n // 2
	if n % 2 == 0:
		print(f"{r}\n{'2 ' * r}")
	else:
		print(f"{r}\n{'2 ' * (r - 1) + '3'}")
main()


n = int(input())
print(n // 2)
if n % 2 == 0:
	output = ['2'] * (n // 2)
else:
	output = ['2'] * (n // 2 - 1) + ['3']
print(' '.join(output))


n = int(input())
a = []
if n % 2 == 0:
	t = n // 2
	print(t)
	print('2 ' * t)
else:
	t = n // 2
	print(t)
	t = t - 1
	print('2 ' * t + '3')


a = []
x = int(input())
if x % 2 == 1:
	a.append(3)
	x -= 3
while x > 0:
	a.append(2)
	x -= 2
a.sort()
print(len(a))
print(*a)


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


def sum_prime(num):
	if num == 3:
		return 3
	if num % 2 == 0:
		st = '2'
		while num != 2:
			st += ' '
			st += '2'
			num -= 2
		return st
	else:
		st = '2'
		while num != 5:
			st += ' '
			st += '2'
			num -= 2
		return st + ' ' + '3'
num = int(input())
print(num // 2)
print(sum_prime(num))


num = int(input(''))
div = int(num / 2)
if num % 2 == 0:
	print(div)
	for i in range(div):
		print(2, end=' ')
else:
	print(div)
	for i in range(div - 1):
		print(2, end=' ')
	print(3)


import sys
n = int(input())
res = int(n / 2)
print(res)
if n % 2 == 0:
	for i in range(res):
		sys.stdout.write('2 ')
	sys.stdout.write('\n')
else:
	for i in range(res - 1):
		sys.stdout.write('2 ')
	sys.stdout.write('3\n')


n = int(input())
l = []
if n % 2 == 0:
	x = n // 2
	l.extend([2] * x)
else:
	x = n // 2 - 1
	l.extend([2] * x + [3])
print(len(l))
print(*l)


n = int(input())
k = 2
prime_numbers = []
while n // k != 0:
	if n % k != 0:
		for i in range(n // k - 1):
			prime_numbers.append(k)
		n = n - (n // k - 1) * k
		k += 1
	else:
		for i in range(n // k):
			prime_numbers.append(k)
		n = n - (n // k - 1) * k
		k += 1
print(len(prime_numbers))
print(*prime_numbers)


n = int(input())
k = 0
c = []
if n % 2 == 0:
	k += n // 2
	c = [2] * (n // 2)
else:
	k += n // 2
	c = [2] * (n // 2 - 1)
	c.append(3)
print(k)
for i in c:
	print(i, end=' ')
print()


a = int(input())
print(a // 2)
while a > 3:
	print(2, end=' ')
	a = a - 2
print(a)


def Prime(n):
	flag = 1
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			flag = 0
			break
	if flag:
		return True
	else:
		return False
n = int(input())
k = 0
L = []
while n > 0:
	if n > 3 or n == 2:
		k += 1
		L.append(2)
		n -= 2
	elif n == 3:
		k += 1
		L.append(3)
		n -= 3
print(k)
for i in range(len(L)):
	print(L[i], end=' ')


n = int(input())
factor = []
if n % 2:
	factor.append(3)
	n = n - 3
if not n % 2:
	for i in range(n // 2):
		factor.append(2)
print(len(factor))
print(*factor)


from collections import defaultdict

class PrimeCounter(object):

	def __init__(self, number):
		self.number = number
		self.counter = defaultdict(int)
		self.summary = list()

	def count(self, prime):
		self.counter[prime] += 1
		self.number -= prime
		self.summary.append(prime)

	def undo(self, prime):
		self.counter[prime] -= 1
		self.number += prime
		self.summary.pop()

	def get_summary(self):
		return (len(self.summary), self.summary)

def get_primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def greedy(number):
	primes = sorted(get_primes(number + 1))
	i = 0
	count = defaultdict(int)
	pc = PrimeCounter(number)
	while pc.number > 0:
		prime = primes[i]
		if prime <= pc.number:
			pc.count(prime)
		else:
			pc.undo(prime)
			i += 1
	return pc.get_summary()

def number_theory(number):
	if number % 2 == 0:
		max_count = number // 2
		return (max_count, [2] * max_count)
	max_count = (number - 3) // 2
	return (max_count + 1, [2] * max_count + [3])

def solve(number):
	return greedy(number)

def main():
	N = int(input())
	(max_count, primes_used) = solve(N)
	print(max_count)
	print(' '.join([str(x) for x in primes_used]))
	return (max_count, primes_used)
main()


n = int(input())
if n == 2:
	print('1')
	print('2')
elif n == 3:
	print('1')
	print('3')
elif n % 2 == 0 and n > 3:
	print(n // 2)
	for i in range(n // 2):
		print('2', end=' ')
elif n % 2 == 1 and n > 3:
	print(n // 2)
	for i in range(n // 2 - 1):
		print('2', end=' ')
	print('3')


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


n = int(input())
s = 0
r = []
if n % 2 != 0:
	s += 1
	n -= 3
	r.append(3)
s += n // 2
r += [2 for i in range(n // 2)]
print(s)
print(' '.join(map(str, r)))


n = int(input())
if n > 1 and n % 2 == 0:
	g = n // 2
	print(g)
	print('2 ' * g)
elif n > 1 and n % 2 == 1:
	g = n // 2
	print(g)
	g -= 1
	end = '2 ' * g
	final = end + '3'
	print(final)


n = int(input())
if n % 2 == 0:
	k = int(n / 2)
	print(k)
	for _ in range(k - 1):
		print('2', end=' ')
	print('2')
elif n == 3:
	print(1)
	print(3)
else:
	k = int(n / 2)
	print(k)
	for _ in range(k - 1):
		print('2', end=' ')
	print('3')


n = int(input())
if n % 2 == 0:
	primes = [2] * (n // 2)
else:
	primes = [2] * ((n - 3) // 2) + [3]
print(len(primes))
print(' '.join(map(str, primes)))


n = int(input())
if n == 2:
	print(1)
	print(2)
elif n == 3:
	print(1)
	print(3)
else:
	count = 0
	l = []
	while n > 3:
		n -= 2
		l.append(2)
	l.append(n)
	print(len(l))
	print(' '.join(map(str, l)))


n = int(input())
if n == 2:
	print(1)
	print(2)
elif n == 3:
	print(1)
	print(3)
elif n % 2 == 0:
	print(int(n / 2))
	print(' '.join([str(2)] * int(n / 2)))
elif n % 2 == 1:
	print(int(n / 2))
	print(' '.join([str(2)] * (int(n / 2) - 1) + ['3']))


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : [int(i) for i in inp().split()]
li0 = lambda x: [0 for i in range(x)]
n = iinp()
print(n // 2)
res = '2 ' * (n // 2 - 1)
if n % 2 == 0:
	print(res + '2')
else:
	print(res + '3')


def main():
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		b = 0
	else:
		a = n // 2 - 1
		b = 1
	print(a + b)
	print('2 ' * a + '3 ' * b)
main()


n = int(input())
b = []
print(int(n / 2))
if int(n) % 2 == 0:
	for k in range(int(n / 2)):
		b.append('2')
else:
	for k in range(int(n / 2) - 1):
		b.append('2')
	b.append('3')
print(' '.join(b))


t = int(input())
if t % 2 == 0:
	print(t // 2)
	for i in range(t // 2):
		print(2, end=' ')
	print()
else:
	t = t - 3
	print(t // 2 + 1)
	for i in range(t // 2):
		print(2, end=' ')
	print(3)


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


a = int(input())
st = ''
if a % 2 == 0:
	for i in range(a // 2):
		st += '2' + ' '
	print(a // 2)
	print(st)
else:
	a = a - 3
	for i in range(a // 2):
		st += '2' + ' '
	st += '3'
	print(a // 2 + 1)
	print(st)


from sys import exit as sys_ret
size = int(input())
amount = size // 2
print(amount)
amount -= 1
while amount:
	amount -= 1
	print(2, end=' ')
print(2 if size % 2 == 0 else 3)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	primes = ['2'] * (n // 2)
	print(' '.join(primes))
else:
	print((n - 1) // 2)
	primes = ['2'] * ((n - 1) // 2 - 1) + ['3']
	print(' '.join(primes))


n = int(input())
ans = 0
list = []
if n % 2 == 1:
	list.append(3)
	ans = 1
	n -= 3
while n > 0:
	n -= 2
	list.append(2)
	ans += 1
print(ans)
for i in list:
	print(i, end=' ')


main = int(input())
res = []
if main % 2 == 0:
	for x in range(int(main / 2)):
		res.append('2')
else:
	for x in range(int(main / 2) - 1):
		res.append('2')
	res.append('3')
print(len(res))
print(' '.join(res))


from math import sqrt, ceil
n = int(input())

def issimple(n):
	for i in range(2, ceil(sqrt(n)) + 1):
		if not n % i:
			return False
	return True
if not n % 2:
	print(n // 2)
	print(' '.join(['2' for i in range(n // 2)]))
elif n == 3:
	print(1)
	print('3')
else:
	print((n - 3) // 2 + 1)
	print(' '.join(['2' for i in range((n - 3) // 2)]), end=' ')
	print('3')


import math
n = int(input())
if n % 2 == 1:
	ans = int((n - 3) / 2)
	print(ans + 1)
	for i in range(1, ans + 1, 1):
		print(2, end=' ')
	print(3)
else:
	ans = int(n / 2)
	print(ans)
	for i in range(1, ans + 1, 1):
		print(2, end=' ')


def main():
	n = int(input())
	ans = []
	if n < 4:
		print(1)
		print(n)
	else:
		print(n // 2)
		if n % 2 == 0:
			for i in range(n // 2):
				print(2, end=' ')
		else:
			for i in range(n // 2 - 1):
				print(2, end=' ')
			print(3)
main()


n = int(input())
if n % 2 == 1:
	y = (n - 3) // 2
	print((n - 3) // 2 + 1)
	for i in range(y):
		print('2', end=' ')
	print('3')
else:
	y = n // 2
	print(y)
	for i in range(y):
		print('2', end=' ')


n = int(input().strip())
summ = 0
terms = []
while summ < n:
	if summ + 3 == n:
		terms.append('3')
		summ += 3
	else:
		terms.append('2')
		summ += 2
print(len(terms))
print(' '.join(terms))


n = int(input())
k = n // 2
print(k)
s = ''
while k > 1:
	k -= 1
	s += '2 '
x = 2 + n % 2
s += str(x)
print(s)


t = int(input())
ans1 = 1
ans2 = []
ans1 += t // 2 - 1
t -= 2 * (ans1 - 1)
ans2.extend([2] * (ans1 - 1))
ans2.append(t)
print(ans1)
print(*ans2)


n = int(input())
if n % 2 == 0:
	l = [2] * (n // 2)
	print(len(l))
	print(*l)
else:
	n = n - 3
	l = [2] * (n // 2)
	print(len(l) + 1)
	l.append(3)
	print(*l)


n = int(input())
k = n // 2
t = ['2 '] * k
if n % 2 == 1:
	del t[0]
	t.append('3')
else:
	t[len(t) - 1] = '2'
print(len(t))
for i in t:
	print(i, end='')


n = int(input())
l = []
while n >= 4:
	n -= 2
	l.append(2)
l.append(n)
l = list(map(str, l))
print(len(l))
print(' '.join(l))


import math, sys, re, itertools, pprint, collections, copy
(rs, ri, rai, raf) = (input, lambda : int(input()), lambda : list(map(int, input().split())), lambda : list(map(float, input().split())))
n = ri()
if n % 2 == 0:
	res = [2] * (n // 2)
else:
	k = n - 3
	res = [3] + [2] * (k // 2)
print(len(res))
print(' '.join(map(str, res)))


import math
from collections import *
import sys
from functools import reduce

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

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
if n & 1:
	print((n - 3) // 2 + 1)
	print(*[2] * ((n - 3) // 2), 3)
else:
	print(n // 2)
	print(*[2] * (n // 2))


n = int(input())
print(n // 2)
ch = ''
for i in range(n // 2 - 1):
	ch += '2 '
if n % 2 == 1:
	ch += '3'
else:
	ch += '2'
print(ch)


n = int(input())
s = ''
for i in range(1, int(n / 2)):
	s += '2 '
print(int(n / 2), '\n' + s + str(2 + n % 2))


import math
import itertools

def is_prime(n):
	if n < 2:
		return False
	elif n == 2:
		return True
	elif n % 2 == 0:
		return False
	for div in range(2, math.ceil(math.sqrt(n))):
		if n % div == 0:
			return False
	return True

def generate_infinite_primes():
	for num in itertools.count():
		if is_prime(num):
			yield num

def maximum_possible(n):
	arr = []
	primes = generate_infinite_primes()
	prime = next(primes)
	while n:
		if n - prime > 1 or n - prime == 0:
			arr.append(prime)
			n -= prime
		else:
			prime = next(primes)
	return arr
res = maximum_possible(int(input()))
print(len(res))
print(*res)


n = int(input())
res = int(n / 2)
print(res)
if n % 2 == 0:
	print(' '.join(['2' for _ in range(res)]))
else:
	print(' '.join(['2' for _ in range(res - 1)]), end=' ')
	print('3')


from sys import stdin, stdout
n = int(stdin.readline())
if n < 4:
	stdout.write('1\n')
	stdout.write(str(n))
elif n % 2 == 0:
	out = '2 ' * (n // 2)
	stdout.write(str(n // 2) + '\n')
	stdout.write(out.strip())
else:
	out = '2 ' * (n // 2 - 1) + '3'
	stdout.write(str(n // 2) + '\n')
	stdout.write(out)


def solve(n):
	if n <= 3:
		return [n]
	else:
		res = [2 for x in range(int(n / 2))]
		if n % 2 == 0:
			return res
		else:
			res[-1] = 3
			return res
n = int(input())
res = solve(n)
print(len(res))
print(' '.join([str(x) for x in res]))


n = int(input())
if n % 2 == 0:
	a = int(n / 2)
	print(a)
	count = 0
	for i in range(a):
		print(2)
else:
	b = int(n / 2 + 1)
	print(b - 1)
	for i in range(b - 2):
		print(2)
	print(3)


n = int(input())
print(n // 2 if n % 2 == 0 else max(0, (n - 3) // 2) + 1)
while n > 3:
	n -= 2
	print(2, end=' ')
print(n)


def main():
	N = int(input())
	if N == 2 or N == 3:
		print(1)
		print(N)
	elif N % 2 == 0:
		print(N // 2)
		print(*[2] * (N // 2))
	else:
		print((N - 1) // 2)
		print(*[2] * ((N - 3) // 2), 3)
main()


n = int(input())
print(n // 2)
if n % 2 == 1:
	print(3, end=' ')
	n -= 3
while n > 0:
	print(2, end=' ')
	n -= 2


inp = int(input())
num = int()
matrix = []
num = inp // 2
for x in range(num):
	matrix.append(str(2))
if inp % 2 != 0:
	matrix.remove(str(2))
	matrix.append(str(3))
print(len(matrix))
print(' '.join(matrix))


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


n = int(input())
ans1 = n // 2
ans2 = [2] * (ans1 - 1)
if n % 2 != 0:
	ans2.append(3)
else:
	ans2.append(2)
print(ans1)
for x in ans2:
	print(x, end=' ')


num = int(input())
oSum = 0
eSum = 0
count = 0
n = num
maxP = list()
if num % 2 != 0:
	while True:
		if num == n:
			n = n - 1
			n = n / 2
			n = n - 1
		if n != count:
			oSum = oSum + 2
			maxP.append(2)
		else:
			oSum = oSum + 3
			maxP.append(3)
		count = count + 1
		if oSum == num:
			break
if num % 2 == 0:
	while True:
		eSum = eSum + 2
		maxP.append(2)
		count = count + 1
		if eSum == num:
			break
astr = ' '.join(map(str, maxP))
if num % 2 == 0:
	print(count)
	print(astr)
else:
	print(count)
	print(astr)


n = int(input())
count = 0
if n == 2:
	print(str(1) + '\n' + str(2))
elif n == 3:
	print(str(1) + '\n' + str(3))
elif n % 2 == 0:
	print(str(n // 2) + '\n' + '2 ' * (n // 2))
else:
	print(str(n // 2) + '\n' + '2 ' * (n // 2 - 1) + '3')


a = int(input())
l = []
while a > 3:
	l.append(2)
	a -= 2
if a == 3:
	l.append(3)
elif a == 2:
	l.append(2)
print(len(l))
print(*l)


import math
n = int(input())
if n % 2 == 0:
	r = int(n / 2)
	print(r)
	l3 = [2] * r
	print(*l3)
else:
	condition = True
	l1 = [3]
	n -= 3
	while n > 0:
		if n % 2 == 0:
			for i in range(int(n / 2)):
				l1.append(2)
				n -= 2
	print(len(l1))
	print(*l1)


n = int(input())
ans = []
while n > 3:
	ans.append(2)
	n -= 2
ans.append(n)
print(len(ans))
for i in ans:
	print(i, end=' ')


n = int(input())
print(n // 2)
if not n % 2:
	print('2 ' * (n // 2), end='')
else:
	print('2 ' * (n // 2 - 1), end='')
	print('3')


N = int(input())
if N & 1:
	N -= 3
	print(N // 2 + 1)
	for i in range(N // 2):
		print('2 ', end='')
	print(3)
else:
	print(N // 2)
	for i in range(1, N // 2):
		print('2 ', end='')
	print(2)


i = int(input())
j = 0
if i % 2 == 0:
	j = i // 2
	print(j)
	for _ in range(j):
		print(2, end=' ')
else:
	j = i // 2 - 1
	print(j + 1)
	for _ in range(j):
		print(2, end=' ')
	print(3)


n = int(input())
if n % 2 == 0:
	c2 = int(n / 2)
	c3 = 0
else:
	c3 = 1
	n -= 3
	c2 = int(n / 2)
print(c2 + c3)
for i in range(c2):
	print('2', end=' ')
if c3 == 1:
	print('3')


prime = int(input())
if prime % 2 == 0:
	print(prime // 2)
	print('2 ' * (prime // 2))
else:
	print(prime // 2)
	print('2 ' * (prime // 2 - 1) + '3')


number = int(input())
if number % 2 == 0:
	print(number // 2)
	print('2 ' * (number // 2))
else:
	a = '2 ' * (number // 2 - 1) + '3'
	print(number // 2)
	print(a)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	t = n // 2
	print(' 2 ' * t)
else:
	print(n // 2)
	print('3 ')
	n = n - 3
	t = n // 2
	print('2 ' * t)


a = int(input())
suma = []
sumaa = [3]
c = ''
if a % 2 == 0:
	print(a // 2)
	for i in range(a // 2):
		suma.append(2)
	for k in suma:
		c = c + str(k) + ' '
	print(c)
else:
	print(a // 2)
	for i in range(a // 2 - 1):
		sumaa.append(2)
	for k in sumaa:
		c = c + str(k) + ' '
	print(c)


n = int(input())
count = 0
res = []
if n % 2 == 0:
	count = int(n / 2)
	res = count * [2]
else:
	while n % 2 != 0:
		count += 1
		n -= 3
		res.append(3)
	count += int(n / 2)
	list1 = int(n / 2) * [2]
	res.extend(list1)
print(count)
print(*res)


n = int(input())
if n % 2 == 0:
	k = n // 2
	print(k)
	print('2 ' * k)
else:
	k = n // 2
	k = k - 1
	print(k + 1)
	print('2 ' * k, '3', sep='')


n = int(input())
ans = []
if n & 1:
	if n == 3:
		ans.append(3)
	else:
		n -= 3
		ans = [2 for _ in range(n // 2)]
		ans.append(3)
else:
	ans = [2 for _ in range(n // 2)]
print(len(ans))
for val in ans:
	print(val, end=' ')


def bachgold():
	n = int(input())
	if n > 10 ** 5 or n < 2:
		return
	if n % 2 == 0:
		c = n // 2
		print(c)
		print('2 ' * c)
	else:
		c = (n - 3) // 2
		print(c + 1)
		print('2 ' * c, '3')
bachgold()


n = int(input())
od = n % 2
ev = n // 2 - od
print(ev + od)
print('2 ' * ev, '3 ' * od, sep='')


import sys

def main():
	n = int(sys.stdin.readline())
	bs = bachgold(n)
	bachgold_str = ' '.join(map(str, bs))
	print(len(bs))
	print(bachgold_str)

def bachgold(n):
	if n % 2 == 0:
		return [2] * (n // 2)
	else:
		d = [2] * (n // 2 - 1)
		d.append(3)
		return d
main()


n = int(input())
li = []
if n % 2 == 0:
	li = [2 for x in range(1, n // 2 + 1)]
else:
	li = [2 for x in range(1, n // 2)]
	li.append(3)
print(len(li))
for ele in li:
	print(ele, end=' ')


a = int(input())
k = a // 2
print(k)
if a % 2 == 1:
	for i in range(k - 1):
		print(2, end=' ')
	print(3)
else:
	for i in range(k):
		print(2, end=' ')


import sys
import math
import bisect

def solve(n):
	if n == 2:
		return [2]
	if n == 3:
		return [3]
	if n % 2 == 0:
		return [2] * (n // 2)
	ans = [3]
	n -= 3
	while n:
		ans.append(2)
		n -= 2
	return ans

def main():
	n = int(input())
	ans = solve(n)
	print(len(ans))
	print(' '.join(list((str(a) for a in ans))))
main()


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
n = ii()
if n % 2 == 0:
	a = n // 2
	print(a)
	print((a - 1) * '2 ' + 1 * '2')
else:
	a = (n - 3) // 2
	print(a + 1)
	print(a * '2 ' + '3')


n = int(input())
partition_length = n // 2
print(partition_length)
partition = [2] * partition_length
if n % 2 == 1:
	partition[0] = 3
print(*partition)


import sys
import os
import math

def changeStdioToFile():
	path = os.path.dirname(os.path.abspath(__file__))
	sys.stdin = open(f'{path}/input.txt', 'r')
	sys.stdout = open(f'{path}/output.txt', 'w')

def isPrime(x):
	if x < 2:
		return False
	for i in range(2, math.sqrt(x)):
		if x % i == 0:
			return True
	return False
t = 1
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		x = n // 2
		print(x)
		print(x * '2 ')
	else:
		x = (n - 3) // 2
		print(x + 1)
		print(x * '2 ' + '3')


def solve(number):
	if number % 2 == 0:
		max_count = number // 2
		return (max_count, [2] * max_count)
	max_count = (number - 3) // 2
	return (max_count + 1, [2] * max_count + [3])

def main():
	N = int(input())
	(max_count, primes_used) = solve(N)
	print(max_count)
	print(' '.join([str(x) for x in primes_used]))
	return (max_count, primes_used)
main()


import sys
import collections
from collections import Counter
import itertools
import math
import timeit
input = sys.stdin.readline

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

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

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

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

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
t = n // 2
print(t)
print('2 ' * (t - 1) + '3') if n % 2 else print('2 ' * t)


n = int(input())
res = 1
list = []
while n != 3 and n != 2:
	n -= 2
	list.append(2)
	res += 1
list.append(n)
print(res)
for x in list:
	print(x, end=' ')


n = int(input())
if n % 2:
	r = (n - 3) // 2 + 1
	print(r)
	for i in range(r - 1):
		print('2', end=' ')
	print(''.join('3'))
else:
	r = n // 2
	print(r)
	for i in range(r):
		print('2', end=' ')


number = int(input())
ans = number // 2
lst = ['2'] * ans
if number % 2 == 1:
	lst[-1] = '3'
print(ans)
print(' '.join(lst))


n = int(input())
ans = ''
if n % 2 == 0:
	for _ in range(n // 2):
		ans += '2 '
else:
	for _ in range(n // 2 - 1):
		ans += '2 '
	ans += '3 '
print(len(ans) // 2)
print(ans)


n = int(input())
s = ''
if n % 2 == 0:
	count = int(n / 2)
	for i in range(0, int(n / 2)):
		s = s + '2 '
else:
	s = '3'
	n = n - 3
	count = int(n / 2) + 1
	for i in range(0, int(n / 2)):
		s = s + ' 2'
print(count)
print(s)


print((lambda n: str(n // 2) + '\n' + ' '.join(['2' for i in range(n // 2 - 1)] + (['3'] if n % 2 else ['2'])))(int(input())))


n = int(input())
print(n // 2)
if n % 2 == 0:
	a = ['2'] * (n // 2)
	print(' '.join(a))
else:
	a = ['2'] * (n // 2 - 1)
	a.append('3')
	print(' '.join(a))


n = int(input())
print(n // 2)
print(*list([2] * (n // 2 - 1) + [3 if n & 1 else 2]), sep=' ')


lst = []
j = 0
x = int(input())
if x % 2 == 0:
	for i in range(x // 2):
		lst.append(2)
		j += 1
else:
	for m in range(x // 2 - 1):
		lst.append(2)
		j += 1
	lst.append(3)
	j += 1
print(j)
for l in range(len(lst)):
	print(lst[l], '', end='')


def bachgold(n):
	l = []
	if n % 2 == 0:
		l = [2] * round(n / 2)
	else:
		l = [2] * round((n - 3) / 2)
		l += [3]
	return l
n = int(input())
ba = bachgold(n)
print(len(ba))
for i in ba:
	print(i, end=' ')


import math
import sys
import heapq
from collections import deque, defaultdict
from itertools import permutations, combinations, combinations_with_replacement
import random
import os
mod = 10 ** 9 + 7
MAX = sys.maxsize
MIN = -sys.maxsize - 1

def isPrime(n):
	if n > 1:
		for i in range(2, n):
			if n % i == 0:
				return False
		else:
			return True
	else:
		return False

def isPanagram(s):
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	for char in alphabet:
		if char not in s.lower():
			return False
	return True

def isEqual(list1):
	if len(list1) < 0:
		res = True
	res = all((ele == list1[0] for ele in list1))
	if res:
		return True
	else:
		return False

def remove_duplicate(list1):
	final_list = []
	for i in list1:
		if i not in final_list:
			final_lis.append(i)
	return final_list

def solve():
	n = int(input())
	k = n
	ar = []
	if k % 2 == 0:
		a = k // 2
		print(a)
		print('2 ' * a)
	else:
		for i in range(n // 2 - 1):
			ar.append(2)
		ar.append(3)
		print(len(ar))
		print(*ar)
res = solve()


n = int(input())
p = []
while n > 3:
	p.append(2)
	n -= 2
p.append(n)
print(len(p))
for i in range(0, len(p)):
	print(p[i], end=' ')


n = int(input())
k = (n - 2) // 2
ans = 1 + k
print(ans)
if n & 1:
	print(3, end=' ')
else:
	print(2, end=' ')
for i in range(k):
	print(2, end=' ')


a = int(input())
if a % 2 == 0:
	f = int(a / 2)
	print(f)
	m = int(a / 2)
	for i in range(m):
		(print(2, end=' '),)
else:
	k = int((a - 3) / 2 + 1)
	print(k)
	z = int((a - 3) / 2)
	for i in range(z):
		(print(2, end=' '),)
	(print(3),)


n = int(input())
ans = []
if n % 2:
	ans.append(3)
	n -= 3
for i in range(n // 2):
	ans.append(2)
print(len(ans))
print(*ans)


import sys
n = int(input())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print('2', end=' ')
else:
	print((n - 1) // 2)
	for i in range((n - 1) // 2 - 1):
		print('2', end=' ')
	print('3', end=' ')
print()


print(*(lambda N: (str(N // 2), '\n', *tuple((2 for _ in range(N // 2 - 1))), 3 if N % 2 else 2))(int(input())))


import sys
a = int(input())
if a % 2 == 0:
	b = int(a / 2)
	print(b)
	c = [2 for _ in range(b)]
	c = list((str(i) for i in c))
	c = ' '.join(c)
	print(c)
else:
	b = int(a // 2)
	print(b)
	c = [2 for _ in range(b - 1)]
	c.append(3)
	c = list((str(i) for i in c))
	c = ' '.join(c)
	print(c)


def main(n):
	l = []
	if n <= 3:
		l.append(n)
		return l
	if n % 2 == 1:
		l.append(3)
		n -= 3
	if n >= 2:
		l = l + [2] * (n // 2)
	return l
l = main(int(input()))
print(len(l))
print(' '.join(list(map(str, l))))


n = int(input(''))
s = []
if n == 1:
	print(0)
elif n % 2 == 0:
	i = n // 2
	for k in range(i):
		s.append(2)
	print(f'{len(s)}')
	for j in s:
		print(j, end=' ')
else:
	i = (n - 1) // 2
	for k in range(i - 1):
		s.append(2)
	s.append(3)
	print(f'{len(s)}')
	for j in s:
		print(j, end=' ')


n = int(input())
if n == 2:
	print(1)
	print(2)
elif n == 3:
	print(1)
	print(3)
else:
	arr = []
	if n % 2 == 0:
		while n > 0:
			n -= 2
			arr.append(2)
	if n % 2 != 0:
		n -= 3
		arr.append(3)
		while n > 0:
			n -= 2
			arr.append(2)
	print(len(arr))
	for i in arr:
		print(i, end=' ')


n = int(input())
print(n // 2, '\n' + (n - 2) // 2 * '2 ' + '23'[n % 2])


n = int(input())
(m, k) = (n // 2, n % 2)
print(m)
print((m - k) * '2 ' + '3' * k)


n = int(input())
ans = 0
flag = False
if n == 3:
	print(1)
	print(3)
if n == 2:
	print(1)
	print(2)
if n % 2 != 0 and n != 3:
	flag = True
	n -= 3
	ans += 1
	while n:
		n -= 2
		ans += 1
elif n % 2 == 0 and n != 2:
	ans = n // 2
if flag and n != 3:
	print(ans)
	print(3)
	ans -= 1
	while ans:
		print(2)
		ans -= 1
if flag == False and n != 2 and (n != 3):
	print(ans)
	while ans:
		print(2)
		ans -= 1


n = int(input())
k = n // 2
n &= 1
print(k)
print(*[2] * (k - n) + [3] * n)


n = int(input().strip())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print('2 ', end='')
else:
	print(n // 2)
	k = 0
	while k < n - 3:
		print('2 ', end='')
		k += 2
	print(3)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	A = [2] * (n // 2)
	print(*A)
elif n % 2 != 0:
	print((n - 3) // 2 + 1)
	A = [2] * ((n - 3) // 2)
	A.append(3)
	print(*A)


k = int(input())
print(k // 2)
if k % 2 == 0:
	print(*[2] * (k // 2))
else:
	print(*[2] * (k // 2 - 1) + [3])


val = int(input())
array = [2 for i in range(0, val // 2)]
if val % 2 != 0:
	array[0] = 3
output = ''
for i in range(0, len(array)):
	output = output + str(array[i])
	if i != len(array) - 1:
		output = output + ' '
print(len(array))
print(output)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	N = Scanner.int()
	if N % 2 == 0:
		print(N // 2)
		print(*['2' for _ in range(N // 2)], sep=' ')
	else:
		print(N // 2)
		print(*['3'] + ['2' for _ in range(N // 2 - 1)], sep=' ')
main()


n = int(input())
three_cnt = 1 if n % 2 == 1 else 0
two_cnt = n // 2
if three_cnt > 0:
	two_cnt -= 1
print(two_cnt + three_cnt)
print('2 ' * two_cnt, end='')
if three_cnt > 0:
	print('3')


n = int(input())
print(n // 2)
if n % 2:
	print('2 ' * ((n - 2) // 2), 3, sep='')
else:
	print('2 ' * (n // 2))


n = int(input())
s = []
c = int(n // 2 - 1)
if n % 2 == 1:
	for i in range(c):
		s.append(2)
	s.append(3)
	print(len(s))
else:
	for i in range(c + 1):
		s.append(2)
	print(len(s))
print(*s)


import sys
n = int(sys.stdin.readline().split()[0])
if n % 2 == 0:
	print(n // 2)
else:
	n -= 3
	print(n // 2 + 1)
	print('3 ', end='')
for i in range(n // 2):
	print('2 ', end='')


number = input()
print(int(number) // 2)
output = '2 ' * (int(number) // 2 - 1)
if int(number) % 2 == 1:
	print(output + '3')
else:
	print(output + '2')


astr = input('')
try:
	a = int(astr)
except ValueError:
	print('The argument does not contain explicitly numbers')
if a >= 0:
	if a % 2 == 0:
		b = int(a / 2)
		print(b)
		c = '2 '
		d = 1
		while d < b:
			c += '2 '
			d += 1
		print(c)
	if a % 2 == 1:
		b = int((a - 1) / 2)
		print(b)
		c = '3 '
		d = 1
		while d < b:
			c += '2 '
			d += 1
		print(c)


n = int(input())
if n % 2 == 0:
	twos_count = n // 2
	threes_count = 0
else:
	twos_count = (n - 3) // 2
	threes_count = 1
print(twos_count + threes_count)
print(' '.join(['2'] * twos_count + ['3'] * threes_count))


from math import floor
n = int(input())
print(floor(n / 2))
if n % 2 == 1:
	print('3 ', end='')
	n -= 3
while n > 0:
	print('2 ', end='')
	n -= 2


n = int(input())
k = n // 2
count = 0
res = []
if not n % 2:
	for i in range(k):
		res.append(2)
		count += 1
elif n % 2:
	for i in range(k - 1):
		res.append(2)
		count += 1
	res.append(3)
	count += 1
print(count)
print(*res)


def fun(n):
	if n % 2 == 0:
		count_2 = int(n / 2)
		print(count_2)
		return '2 ' * count_2
	else:
		count_2 = int(n / 2) - 1
		print(count_2 + 1)
		return '2 ' * count_2 + '3'
n = int(input())
print(fun(n))


n = int(input())
print(n // 2)
if n % 2:
	print(' '.join('2' * (n // 2 - 1) + '3'))
else:
	print(' '.join('2' * (n // 2)))


n = int(input())
if n == 2:
	print(1)
	print(2)
elif n == 3:
	print(1)
	print(3)
else:
	l = [2] * (n // 2 - 1)
	n -= 2 * (n // 2 - 1)
	if n == 3:
		n = 0
		l.append(3)
	else:
		n = 0
		l.append(2)
	print(len(l))
	print(' '.join((str(i) for i in l)))


n = int(input())
x = [2, 3]
if n <= 3:
	print(1)
	print(n)
else:
	print(n // 2)
	if n % 2 != 0:
		print(' '.join(['2'] * (n // 2 - 1) + ['3']))
	else:
		print(' '.join(['2'] * (n // 2)))


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	print((int(n / 2) - 1) * '2 ' + '2')
elif n > 3 and n % 2 != 0:
	print(int(n // 2))
	print((int(n // 2) - 1) * '2 ' + '3')
elif n == 3:
	print(1)
	print(3)


n = int(input())
if n == 3:
	print(1)
	print(3)
elif n % 2 == 0:
	a = [2] * int(n / 2)
	print(len(a))
	print(*a)
else:
	a = [2] * int((n - 3) / 2) + [3]
	print(len(a))
	print(*a)


n = int(input())
f = n // 2
print(f)
if n & 1:
	n -= 3
	while n:
		print(2, end=' ')
		n -= 2
	print(3)
else:
	while n:
		print(2, end=' ')
		n -= 2


n = int(input())
ans = [2 for x in range((n - 2) // 2)] + [3 if n % 2 != 0 else 2]
print(n // 2)
print(*ans)


n = int(input())
res = []
if n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2)):
		res.append(2)
else:
	print(int(n / 2))
	for j in range(int(n / 2) - 1):
		res.append(2)
	res.append(3)
print(*res, sep=' ')


n = int(input())
if n % 2 == 0:
	ans = [2] * (n // 2)
else:
	n1 = n // 2
	n1 -= 1
	ans = [2] * n1
	ans.append(3)
print(len(ans))
for i in range(len(ans) - 1):
	print(ans[i], end=' ')
print(ans[-1])


n = int(input())
l = []
if n >= 3 and n % 2 != 0:
	while n > 3:
		n -= 2
		l.append(str(2))
	l.append(str(3))
elif n == 2:
	l.append(str(2))
elif n >= 3 and n % 2 == 0:
	while n >= 2:
		n -= 2
		l.append(str(2))
print(len(l))
print(' '.join(l))


def solve():
	n = int(input())
	temp = n
	ans = 0
	arr = []
	for i in range(2, n + 1):
		if temp % i == 0:
			for x in range(int(temp // i)):
				arr.append(i)
			break
		elif temp % i < i:
			for x in range(int(temp // i) - 1):
				arr.append(i)
			temp = temp - (int(temp // i) - 1) * i
		if temp == 0:
			break
	print(len(arr))
	stri = ' '.join([str(x) for x in arr])
	print(stri)
solve()


n = int(input())
if n % 2 == 0:
	print(n // 2)
	x = [2 for i in range(n // 2)]
	print(*x)
else:
	print(n // 2)
	x = [2 for i in range(n // 2)]
	x.pop()
	x.append(3)
	print(*x)


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
n = int(input())
print(n // 2)
if n % 2 == 0:
	ans = [2] * (n // 2)
	print(*ans)
else:
	ans = [2] * (n // 2 - 1) + [3]
	print(*ans)


n = int(input())
three = False
if n % 2 == 1:
	n -= 3
	three = True
deuces = n // 2
print(three + deuces)
if three:
	print(3, end=' ')
print(*[2] * deuces, sep=' ')


N = int(input())
ans1 = N // 2
if N % 2 == 0:
	ans2 = [2 for _ in range(ans1)]
else:
	ans2 = [2 for _ in range(ans1 - 1)]
	ans2.append(3)
print(ans1)
print(' '.join(map(str, ans2)))


def func(n):
	res = []
	if n & 1 == 1:
		res.append(3)
		n -= 3
	while n:
		res.append(2)
		n -= 2
	print(len(res))
	for ele in res:
		print(ele, end=' ')
n = int(input())
func(n)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print(n // 2 * '2 ', end=' ', sep=' ')
else:
	print(n // 2)
	print((n // 2 - 1) * '2 ', '3', end=' ', sep='')


a = int(input())
k = 1
p = ''
if a % 2:
	while a > 3:
		k += 1
		a -= 2
		p = p + '2 '
	print(k)
	print(p + '3')
else:
	while a:
		k += 1
		a -= 2
		p = p + '2 '
	print(k - 1)
	print(p)


n = int(input())
a = '2'
b = '3'
c = n // 2
if n % 2 == 0:
	print(c)
	print(c * (a + ' '))
else:
	print(c)
	print((c - 1) * (a + ' ') + b)


n = int(input())
cnt = 0
a = []
if n % 2 == 1 and n > 2:
	n -= 3
	cnt += 1
	a.append(3)
cnt2 = n // 2
a.extend([2] * cnt2)
print(cnt + cnt2)
print(' '.join(map(str, a)))


inp = input()
chars = inp.split()
n = int(chars[0])
if n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2)):
		print(2, end=' ')
	print()
else:
	print(int((n - 1) / 2))
	for i in range(int((n - 3) / 2)):
		print(2, end=' ')
	print(3)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print(('2 ' * (n // 2)).rstrip(' '))
else:
	n -= 3
	print(n // 2 + 1)
	print(('2 ' * (n // 2)).rstrip(' '), end=' ')
	print(3)


a = int(input(''))
b = int(a / 2)
if a % 2 == 0:
	print(b)
	print(b * '2 ')
else:
	print(b)
	print((b - 1) * '2 ' + '3')


n = int(input())
if n % 2 == 0:
	o1 = int(n / 2)
	o2 = ' '.join(['2'] * o1)
	print(o1)
	print(o2)
else:
	o1 = int((n - 1) / 2)
	o2 = ' '.join(['2'] * (o1 - 1) + ['3'])
	print(o1)
	print(o2)


n = int(input())
print(n // 2)
a = [2] * (n // 2)
if n % 2 != 0:
	a[-1] = 3
print(*a)


n = int(input())
ans = []
if n == 1:
	ans = ['1']
elif n % 2 == 0:
	ans = ['2'] * (n // 2)
else:
	ans.append('3')
	n -= 3
	ans.extend(['2'] * (n // 2))
print(len(ans))
s = ' '.join(ans)
print(s)


n = int(input())
w = int(n / 2) - 1
s = int(n / 2)
print(s)
if n % 2 == 0:
	for i in range(0, w, 1):
		print('2', end=' ')
	print('2')
if n % 2 == 1:
	for i in range(0, w, 1):
		print('2', end=' ')
	print('3')


isDebug = False
n = int(input())
r = int(n % 2)
t = int(n / 2)
print(f'r={r}, t={t}') if isDebug else ''
a = ['2']
if r == 1:
	a = a * (t - 1)
	a.append('3')
else:
	a = a * t
print(len(a))
print(' '.join(a))


K = int(input())
ans = ''
if K % 2 == 1:
	ans = '3'
	K -= 3
else:
	ans = '2'
	K -= 2
index = 0
while index * 2 < K:
	ans = '2 ' + ans
	index += 1
print(index + 1)
print(ans)


n = int(input())
ans = []
while n >= 2:
	n -= 2
	ans.append(2)
if n:
	ans[-1] += 1
print(len(ans))
print(*ans)


n = int(input())
ans = n // 2
s = False
if n % 2 != 0:
	s = True
print(ans)
for i in range(ans - 1):
	print(2, end=' ')
if s == True:
	print(3)
else:
	print(2)


x = 0
arr = list()
n = int(input())
while n > 0:
	if n != 3:
		arr.append(2)
		n = n - 2
	elif n == 3:
		arr.append(3)
		n = n - 3
	x = x + 1
print(x)
for i in arr:
	print(i)


i = int(input())
print(i // 2)
while i > 3:
	print(2, end=' ')
	i = i - 2
print(i)


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


q = int(input())
if q % 2 == 1:
	s = (q - 2) // 2 + 1
else:
	s = q // 2
print(s)
print('2 ' * s if q % 2 == 0 else '2 ' * (s - 1) + '3')


n = int(input())
c = 0
if n % 2 == 0:
	c = int(n / 2)
	print(c)
	print('2', end='')
	for i in range(1, c):
		print(' 2', end='')
elif n == 3:
	print('1')
	print('3')
else:
	c = int(n / 2)
	print(c)
	print('2', end='')
	for i in range(1, c - 1):
		print(' 2', end='')
	print(' 3')


a = int(input())
print(int(a / 2))
if a % 2 == 0:
	for index in range(int(a / 2)):
		print('2 ', end='')
else:
	for index in range(int(a / 2) - 1):
		print('2 ', end='')
	print('3')
print('')


N = int(input())
if N % 2 == 0:
	print(N // 2)
	print('2 ' * (N // 2))
else:
	print(N // 2)
	N -= 3
	print('2 ' * (N // 2) + '3')


n = int(input())
if n % 2 == 0:
	a = [2] * (n // 2)
	print(len(a))
	print(*a)
else:
	a = [2] * ((n - 3) // 2)
	a = a + [3]
	print(len(a))
	print(*a)


n = int(input().strip())
if n & 1:
	ls = [2] * (n // 2 - 1) + [3]
else:
	ls = [2] * (n // 2)
print(n // 2)
print(' '.join(map(str, ls)))


a = int(input())
print(a // 2)
z = ''
while a > 3:
	z += '2 '
	a -= 2
z = z[:-1]
print(z, a)


a = int(input())
print(a // 2)
r = ''
for i in range(a // 2 - 1):
	r += '2 '
if a % 2 == 1:
	r += '3'
else:
	r += '2'
print(r)


n = int(input())
e = 0
o = 0
z = []
if n % 2 == 0:
	while e < n:
		e = e + 2
		z.append(2)
	print(len(z))
	for i in z:
		print(i, end='')
		print(' ', end='')
else:
	while o < n - 3:
		o = o + 2
		z.append(2)
	z.append(3)
	print(len(z))
	for i in z:
		print(i, end='')
		print(' ', end='')


n = int(input())
print(n // 2)
for i in range(n // 2 - 1):
	print(2, end=' ')
print(2 + int(n % 2 != 0))


def fill(n):
	ans = ''
	for i in range(n):
		ans += '2 '
	return ans
n = int(input())
ans1 = n // 2
ans2 = []
ans2 = fill(ans1 - 1)
if n % 2 == 1:
	ans2 += '3'
else:
	ans2 += '2'
print(ans1)
print(ans2)


n = int(input())
if n == 3:
	print(1)
	print(3)
elif n & 1:
	a = n // 2
	print(a)
	for i in range(a - 1):
		print(2, end=' ')
	print(3)
else:
	a = n // 2
	print(a)
	for i in range(a):
		print(2, end=' ')
	print()


n = int(input())
i = 0
if n % 2 == 0:
	k = n // 2
	print(k)
	while i < k:
		print(2, end=' ')
		i = i + 1
if n % 2 != 0:
	k = n // 2
	print(k)
	while i < k - 1:
		print(2, end=' ')
		i = i + 1
	print(3)


n = int(input())
k = n // 2
l = []
if not n % 2:
	for i in range(k):
		l.append(n // k)
else:
	for i in range(k - 1):
		l.append(n // k)
	l.append(3)
print(k)
print(' '.join(map(str, l)))


n = int(input())
print(n // 2)
for i in range(n // 2 - 1):
	print('2')
print(2 + n % 2)


n = int(input())
two = n // 2
if n % 2 != 0:
	two -= 1
three = (n - two * 2) // 3
while two * 2 + three * 3 != n:
	three += 1
	two -= 1
print(two + three)
print('2 ' * two + '3 ' * three)


n = int(input())
count_2 = 0
count = -1
if n % 2 == 0:
	print(n // 2)
	count_2 = n // 2
else:
	print((n - 3) // 2 + 1)
	count = (n - 3) // 2
if count != -1:
	while count > 0:
		print(2, end=' ')
		count -= 1
	print(3, end=' ')
	print()
else:
	while count_2 > 0:
		print(2, end=' ')
		count_2 -= 1
	print()


n = int(input())
if n % 2 == 0:
	arr = [2] * int(n / 2)
else:
	arr = [2] * int(n / 2 - 1)
	arr.append(3)
print(len(arr))
arr = list(map(str, arr))
print(' '.join(arr))


n = int(input())
n_two = n // 2
n_three = 0
if n % 2 == 1:
	n_two -= 1
	n_three += 1
print(n_two + n_three)
print(' '.join(['2'] * n_two + ['3'] * n_three))


c = 0
i = 0
k = 0
a = []
n = int(input())
while n > 3:
	c = c + 1
	a.append(2)
	i = i + 1
	n = n - 2
if n == 3:
	c = c + 1
	print(c)
	a.append(3)
	for i in range(c):
		print(a[i], end=' ')
if n == 2:
	c = c + 1
	print(c)
	a.append(2)
	for i in range(c):
		print(a[i], end=' ')


n = int(input())
q = [2 for i in range(n // 2)]
u = [2 for i in range((n - 3) // 2)]
if n % 2 == 0:
	print(n // 2)
	for i in q:
		print(i, end=' ')
else:
	print((n - 3) // 2 + 1)
	for i in u:
		print(i, end=' ')
	print(3)


n = int(input())
k = int(0)
three = int(0)
two = int(0)
while n != 0:
	if n % 2 == 0:
		k += 1
		two += 1
		n -= 2
	else:
		k += 1
		three += 1
		n -= 3
print(k)
i = int(0)
for i in range(two):
	print('2', end=' ')
for i in range(three):
	print('3', end=' ')


a = int(input())
print(a // 2)
l = []
for i in range(a // 2 - 1):
	l.append(2)
if a % 2 == 0:
	l.append(2)
else:
	l.append(3)
print(' '.join(map(str, l)))


t = int(input())
n = t // 2
print(n)
print('2 ' * (n - 1), end='')
if t % 2 == 0:
	print(2)
else:
	print(3)


a = int(input())
d = 0
if a % 2 != 0:
	a = a - 3
	d += 1
x = a // 2
print(x + d)
for i in range(x):
	print(2, end=' ')
if d == 1:
	print(3)


n = int(input())
print(n // 2)
while n:
	if n is 3:
		print(3, end=' ')
		n -= 3
	else:
		print(2, end=' ')
		n -= 2


n = int(input())
twos = n // 2
if n % 2 == 0:
	solution = [2] * twos
else:
	solution = [2] * (twos - 1) + [3]
print(twos)
for i in solution:
	print(i, end=' ')


N = int(input())
if N == 3:
	print(1)
	print(3)
elif N % 2:
	num = (N - 5) // 2 + 2
	print(num)
	for i in range(num - 2):
		print(2, end=' ')
	print(2, 3)
else:
	num = N // 2
	print(num)
	for i in range(num):
		print(2, end=' ')
	print()


n = int(input())
res = []
if n % 2 == 1:
	res.append(3)
	n -= 3
while n > 0:
	res.append(2)
	n -= 2
print(len(res))
print(*res)


n = int(input())
print(n // 2)
print(' '.join(map(str, [2] * (n // 2 - 1) + [2 + n % 2])))


n = int(input())
result = []
if n % 2 == 1:
	result.append(3)
	n -= 3
twos = n // 2
result.extend([2] * twos)
print(len(result))
print(*result)


number = int(input())
r_data = []
result = 0
while number >= 2:
	if number == 2:
		number -= 2
		r_data.append(2)
		result += 1
	elif number == 3:
		number -= 3
		r_data.append(3)
		result += 1
	else:
		number -= 2
		r_data.append(2)
		result += 1
print(result)
for m in r_data:
	print(m, end=' ')


n = int(input())
if n % 2 == 0:
	digits = n // 2
	print(digits)
	print(*digits * [2], sep=' ')
else:
	digits = n // 2
	print(digits)
	print(*(digits - 1) * [2] + [3], sep=' ')


i = int(input())
print(i // 2)
l = [2] * (i // 2 - i % 2) + [3] * (i % 2)
print(*l)


def solve(n):
	if n % 2 == 0:
		res = n // 2
		return '\n'.join([str(res), ' '.join(['2' for _ in range(n // 2)])])
	else:
		res = (n - 3) // 2 + 1
		ans = ['2' for _ in range((n - 3) // 2)]
		ans.append('3')
		return '\n'.join([str(res), ' '.join(ans)])

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


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	for x in range(int(n / 2)):
		print('2', end=' ')
else:
	d = int((n - 3) / 2)
	print(d + 1)
	for x in range(d):
		print('2', end=' ')
	print('3')


n = int(input().strip())
if n % 2 == 1:
	number = 1 + (n - 3) // 2
	print(number)
	result = ['3'] + ['2' for _ in range((n - 3) // 2)]
	print(' '.join(result))
else:
	number = n // 2
	result = ['2' for _ in range(n // 2)]
	print(number)
	print(' '.join(result))


cnt = 0
n = int(input())
extraN = n
while n > 3:
	cnt += 1
	n -= 2
print(cnt + 1)
while extraN > 3:
	print(2, end=' ')
	extraN -= 2
print(extraN)


n = int(input())
l = []
while n != 0:
	if n % 2 == 0:
		l.append(2)
		n -= 2
	else:
		l.append(3)
		n -= 3
l.sort()
print(len(l))
print(' '.join([str(x) for x in l]))


n = int(input())
print(n // 2)
if n % 2 == 0:
	for i in range(n // 2):
		print(2, end=' ')
else:
	x = 0
	while x < n - 3:
		x += 2
		print(2, end=' ')
	print(3)


n = int(input())
print(n // 2)
res = '2 ' * (n // 2)
res = res[:len(res) - 1] if n % 2 == 0 else res[:len(res) - 2] + '3'
print(res)


n = int(input())
string = '2'
space = ' '
if n % 2 == 0:
	print(n // 2)
	print(space.join(string * (n // 2)))
else:
	print((n - 1) // 2)
	print(space.join(string * ((n - 3) // 2)), 3)


n = int(input())
l = []
while n != 0:
	if n == 3 or n == 2:
		l.append(n)
		break
	else:
		l.append(2)
		n -= 2
print(len(l))
for i in l:
	print(i, end=' ')


def bachgold(x):
	primes = [3]
	ans = []
	if x % 2 == 0:
		val = [2] * (x // 2)
		ans.extend(val)
	else:
		while x > 0:
			if x in primes:
				ans.append(x)
				x = 0
			else:
				x -= 2
				ans.append(2)
	print(len(ans))
	for i in ans:
		print(i, '', end='')
	print()
x = int(input())
if x == 2:
	print(1)
	print(2)
elif x == 3:
	print(1)
	print(3)
else:
	bachgold(x)


k = int(input())
n = 0
ans = []
while k != 3 and k != 0:
	k -= 2
	n += 1
	ans.append('2')
print(n + 1 if k == 3 else n)
if k == 3:
	print(' '.join(ans), k)
else:
	print(' '.join(ans))


n = int(input())
ans = []
while n % 2 != 0:
	ans.append(3)
	n -= 3
ans.extend([2] * (n // 2))
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input())
x = n // 2 * [2]
if n % 2:
	x[-1] = 3
print(len(x))
print(*x)


number = int(input())
if number % 2 == 0:
	x = int(number / 2)
	list1 = []
	for i in range(x):
		list1.append(2)
	print(len(list1))
	list2 = [str(i) for i in list1]
	print(' '.join(list2))
else:
	x = int((number - 1) / 2)
	list2 = []
	for i in range(x):
		list2.append(2)
	list2[-1] = 3
	print(len(list2))
	list3 = [str(i) for i in list2]
	print(' '.join(list3))


inp = int(input())
count = 0
count = inp // 2
print(count)
l = []
if inp % 2 == 0:
	l = [2] * count
else:
	l = [2] * (count - 1)
	l.append(3)
for i in l:
	print(i, end=' ')


n = int(input())
a = []
while n > 3:
	n -= 2
	a.append(2)
a.append(n)
print(len(a))
for x in a:
	print(x, end=' ')


x = int(input())
a = []
if x % 2 == 0:
	y = int(x / 2)
	print(y)
	for i in range(y):
		a.append(2)
else:
	y = int(x / 2)
	print(y)
	for i in range(1, y):
		a.append(2)
	a.append(3)
for i in a:
	print(i, end=' ')


n = int(input())
print(n // 2, '\n', '2 ' * (n // 2 - 1) if n // 2 - 1 > 0 else '', 2 + n % 2, sep='')


n = int(input())
count = 0
if n % 2 != 0:
	num = n - 3
	num_two = int(num / 2)
	count = num_two + 1
	print(count)
	print((count - 1) * '2 ' + '3')
else:
	count = int(n / 2)
	print(count)
	print(count * '2 ')


import sys
n = int(sys.stdin.readline().strip())
res = [2] * ((n - 2) // 2)
res.append(2 if n % 2 == 0 else 3)
print(len(res))
print(' '.join(map(str, res)))


def main():
	n = int(input())
	l = ['2'] * (n // 2)
	if n & 1:
		l[-1] = '3'
	print(len(l))
	print(' '.join(l))
main()


import math
n = int(input())
c = math.floor(n / 2)
r = n % 2
if r == 0:
	arr = ['2' for i in range(c)]
else:
	arr = ['2' for i in range(c - 1)]
	arr.append('3')
print(c)
print(' '.join(arr))


n = int(input())
ar = []
count = 0
while n > 0:
	if n % 2 == 1:
		n = n - 3
		ar.append(3)
		count += 1
	else:
		n = n - 2
		ar.append(2)
		count += 1
print(count)
for i in ar:
	print(i, end=' ')


n = int(input())
l = n // 2
print(l)
if n % 2 != 0:
	print('2 ' * ((n - 3) // 2), sep='', end=' ')
	print(3)
else:
	print('2 ' * (n // 2), sep='', end=' ')


n = int(input())
fac = []
if n % 2 == 1:
	fac.append(3)
	for i in range((n - 3) // 2):
		fac.append(2)
else:
	for i in range(n // 2):
		fac.append(2)
print(len(fac))
print(*fac)


x = int(input())
if x % 2 == 0:
	x //= 2
	print(x)
else:
	x = (x - 1) // 2 - 1
	print(x + 1)
	print('3 ', end='')
print('2 ' * x)


n = int(input())
print(n // 2)
while n > 0:
	if n == 3:
		print(3)
		break
	n -= 2
	print(2, end=' ')


def bachgold(n):
	out = ''
	if n % 2 == 1:
		print(n // 2)
		for i in range(n // 2 - 1):
			out += '2 '
		out += '3 '
	else:
		print(int(n / 2))
		for i in range(int(n / 2)):
			out += '2 '
	print(out.strip())
inN = int(input())
bachgold(inN)


num = int(input())
rng = num // 2
if num % 2 == 0:
	print(rng)
	[print('2', end=' ') for i in range(rng)]
else:
	a = ['2' for i in range(rng - 1)] + ['3']
	print(rng)
	print(' '.join(a))


n = int(input())

def max_primes(n):
	if n % 2 == 0:
		return (n // 2, 0)
	return ((n - 3) // 2, 1)
res = max_primes(n)
print(res[0] + res[1])
print('2 ' * res[0] + ('3' if res[1] else ''))


def main():
	n = int(input())
	if n % 2 != 0:
		x = (n - 3) // 2
		print(n // 2)
		for i in range(x):
			print(2, end=' ')
		print(3, end=' ')
		print()
	else:
		x = n // 2
		print(x)
		for i in range(x):
			print(2, end=' ')
		print()
main()


n = int(input())
a = [2] * (n // 2)
a[-1] += n % 2
print(len(a))
print(*a)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
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 [int(x) for x in sys.stdin.readline().split()]

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

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

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

def S():
	return input()

def main():
	n = I()
	if n == 2:
		print(1)
		print(2)
		exit()
	if n == 3:
		print(1)
		print(3)
		exit()
	l = []
	while True:
		if n == 2:
			print(len(l) + 1)
			print(' '.join([str(x) for x in l]) + ' 2')
			exit()
		if n == 3:
			print(len(l) + 1)
			print(' '.join([str(x) for x in l]) + ' 3')
			exit()
		n -= 2
		l.append(2)
print(main())


import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
import re

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

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

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

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 most_frequent(list):
	return max(set(list), key=list.count)

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

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

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
prime = []
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 main():
	n = inin()
	print(n // 2)
	if n % 2 == 0:
		for i in range(n // 2):
			print('2', end=' ')
	else:
		for _ in range(n // 2 - 1):
			print('2', end=' ')
		print('3')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
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')
main()


def bahgold(n):
	a = list()
	while n > 3 or n == 2:
		n -= 2
		a.append(2)
	if n == 3:
		a.append(3)
	return (len(a), a)
m = int(input())
print(bahgold(m)[0])
print(*bahgold(m)[1])


def sumOfPrimes(x):
	resultArr = []
	result = 0
	i = 2
	while x > 0:
		if x - i > 1 or x - i == 0:
			x -= i
			result += 1
			resultArr.append(i)
		else:
			i += 1
	return (result, resultArr)
x = int(input())
(result, resultArr) = sumOfPrimes(x)
print(result)
for i in resultArr:
	print(i, end=' ')


x = int(input())
print(x // 2)
print('2 ' * (x // 2 - 1), x % 2 + 2)


n = int(input())
if n % 2 == 0:
	k = n // 2
	print(k)
	print(*[2] * k)
elif n > 3:
	res_list = []
	while n > 3:
		res_list.append(2)
		n -= 2
	res_list.append(3)
	print(len(res_list))
	print(*res_list)
else:
	print(1)
	print(n)


n = int(input())
count = 0
temp = []
while n != 0:
	if n == 3:
		count = count + 1
		n -= 3
		temp.append(3)
	else:
		count = count + 1
		n -= 2
		temp.append(2)
print(count)
for ele in temp:
	print(ele, end=' ')


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	ll = []
	for i in range(int(n / 2)):
		ll.append(2)
	ab = ' '.join(map(str, ll))
	print(ab)
if n % 2 != 0:
	print(int((n - 1) / 2))
	mm = int((n - 1) / 2)
	l = []
	for i in range(mm - 1):
		l.append(2)
	l.append(3)
	aa = ' '.join(map(str, l))
	print(aa)


n = int(input())
res = []
if n % 2 == 0:
	m = n // 2
	res = [2 for i in range(m)]
else:
	m = (n - 3) // 2
	res = [2 for i in range(m)]
	res.append(3)
print(len(res))
print(' '.join(map(str, res)))


n = int(input())
if n % 2 == 0:
	t = [2 for i in range(int(n / 2))]
	print(int(n / 2))
	for i in range(len(t)):
		print(t[i], end=' ')
else:
	print(int((n - 3) / 2) + 1)
	q = [2 for i in range(int((n - 3) / 2))]
	for i in range(len(q)):
		print(q[i], end=' ')
	print(3)


n = int(input())
if n % 2 == 0:
	a = n // 2
	q = [2] * a
	print(len(q))
	print(*q)
else:
	c = (n - 2) // 2
	d = n % 2
	e = d + 2
	w = [2] * c + [3]
	print(len(w))
	print(*w)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print('2 ', end='')
elif n % 2 != 0:
	print(n // 2)
	for j in range(n // 2 - 1):
		print('2 ', end='')
	for k in range(1):
		print('3', end='')


n = int(input())
if n % 2 == 0:
	result = [2] * (n // 2)
else:
	result = [2] * ((n - 3) // 2)
	result.append(3)
print(len(result))
for number in result:
	print(number, end=' ')


s = int(input())
pair = bool(0)
if s % 2 == 0:
	pair = True
if pair:
	print(s // 2)
	ch = '2 ' * (s // 2)
	ch = ch[:-1]
	print(ch)
else:
	print(s // 2)
	ch = '2 ' * (s // 2 - 1)
	ch += '3'
	print(ch)


n = int(input())
t = n % 2
d = n // 2 - t
print(t + d)
print('2 ' * d, '3 ' * t, sep='')


number = int(input())
factors = number // 2
print(factors)
for i in range(factors - 1):
	print('2 ', end='')
if number % 2 == 0:
	print('2')
else:
	print('3')


n = int(input())
sums = []
m = n // 2
for i in range(m):
	sums.append('2')
if n % 2:
	sums = sums[:-1] + ['3']
print(m)
print(' '.join(sums))


n = int(input())
res = [2] * (n // 2)
res[-1] += n % 2
print(len(res))
print(' '.join(map(str, res)))


n = int(input())
(th, tw) = (0, 0)
if n & 1:
	th += 1
	n -= 3
while n:
	tw += 1
	n -= 2
print(th + tw)
print('2 ' * tw + '3 ' * th)


def main():
	n = int(input())
	solver(n)

def solver(n):
	k = n // 2
	print(k)
	for i in range(k - 1):
		print(2, end=' ')
	if n % 2 == 0:
		print(2)
	else:
		print(3)
main()


q = lambda : map(int, input().split())
qs = lambda : input().split()
(n,) = q()
print(n // 2, '2 ' * (n // 2) if n % 2 == 0 else '2 ' * (n // 2 - 1) + '3', sep='\n')


n = int(input())
print(n // 2)
ans = [2] * (n // 2 - 1)
ans.append(3) if n % 2 == 1 else ans.append(2)
print(*ans)


import math
n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2)):
		print('2')
else:
	k = math.floor(n / 2)
	print(k)
	for i in range(k - 1):
		print('2')
	print('3')


n = int(input())
op = ''
if n % 2 == 0:
	k = n // 2
	for _ in range(k):
		op += '2 '
else:
	k = (n - 3) // 2 + 1
	for _ in range(k - 1):
		op += '2 '
	op += '3 '
print(k)
print(op[:-1])


n = int(input())
if n < 2:
	print(0)
else:
	p = n // 2
	r = n % 2
	print(p)
	for _ in range(0, p - 1):
		print(2, end=' ')
	if r == 1:
		print(3)
	else:
		print(2)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
else:
	print(n // 2)
	arr = [2] * (n // 2 - 1)
	arr.append(3)
	print('2 ' * (n // 2 - 1) + '3')


m = int(input())
print(m // 2)
if m % 2 == 0:
	print('2 ' * (m // 2))
else:
	print('2 ' * int((m - 3) / 2) + '3')


size = int(input())
if size % 2 == 0:
	print(int(size / 2))
	for i in range(int(size / 2)):
		print(2, end=' ')
elif size == 5:
	print(2)
	print(2, 3)
else:
	sum = size - 3
	print(int(sum / 2) + 1)
	for i in range(int(sum / 2)):
		print(2, end=' ')
	print(3)


n = int(input())
cpt1 = 0
cpt2 = 0
if n % 2:
	cpt2 += 1
	n = n - 3
cpt1 = n // 2
r = '2 ' * cpt1 + '3' * cpt2
print(cpt1 + cpt2)
print(r)


n = int(input())
if n % 2 == 0:
	li = [2] * (n // 2)
else:
	n = n - 3
	li = [2] * (n // 2)
	li.append(3)
print(len(li))
for i in li:
	print(i, end=' ')


n = int(input())
count = 0
res = []
while True:
	if n > 3:
		res.append(2)
		count += 1
		n -= 2
	elif n == 2:
		res.append(2)
		count += 1
		n -= 2
	elif n == 3:
		res.append(3)
		count += 1
		n -= 3
	else:
		break
print(count)
for item in res:
	print(item, end=' ')


n = int(input())
result = ''
if n % 2 == 0:
	result += ' '.join(['2'] * (n // 2))
else:
	result += ' '.join(['2'] * ((n - 2) // 2))
	result += ' 3'
print(n // 2)
print(result)


n = int(input())
print(int(n / 2))
t = int(n / 2)
p = [2] * t
if n % 2 != 0:
	p[0] = 3
for i in range(0, t):
	print(p[i], end=' ')


n = int(input())
c = 0
p = 0
l = []
if n % 2 == 0:
	while n / 2 > 0:
		p += 1
		n = n - 2
		l.append(str(2))
	print(p)
	print(' '.join(l))
else:
	n = n - 3
	while n / 2 > 0:
		c += 1
		n = n - 2
		l.append(str(2))
	l.append(str(3))
	print(c + 1)
	print(' '.join(l))


N = int(input())
(valores, lista) = (int(N / 2), [])
if N % 2 == 0:
	lista.extend('2' * valores)
else:
	lista.extend('2' * (valores - 1))
	lista.append('3')
lista = ' '.join(map(str, lista))
print(valores)
print(lista)


a = int(input())
b = a // 2
print(b)
for _ in range(b - 1):
	print(2, end=' ')
print(a % 2 + 2, end=' ')


number = int(input())
twos = number // 2
if number % 2 == 0:
	primes = '2 ' * twos
else:
	primes = '2 ' * (twos - 1) + '3'
print(twos)
print(primes)


n = int(input())
arr = []
while n > 1:
	if n <= 3:
		arr.append(n)
		break
	else:
		n = n - 2
		arr.append(2)
		if n == 3:
			arr.append(3)
			break
print(len(arr))
for i in range(len(arr)):
	print(arr[i], end=' ')


n = int(input().strip())
p = 0
l = n % 2
if l:
	n -= 3
print(n // 2 + l)
for i in range(n // 2):
	print(2, end='')
	if i != n // 2 - 1:
		print(' ', end='')
if l:
	if n // 2:
		print(' ', end='')
	print('3')


n = int(input())
s = []
st = ''
print(n // 2)
if n % 2 == 0:
	st += '2' * (n // 2)
	s += st
	for i in s:
		print(int(i))
elif n % 2 != 0:
	st += '2' * (n // 2 - 1) + '3'
	s += st
	for i in s:
		print(int(i))


x = input()
x = int(x)
print(x // 2)
for i in range(x // 2):
	if x % 2 == 1 and i == x // 2 - 1:
		print(3)
	else:
		print(2, end=' ')


n = int(input())
res = ''
if n % 2 == 0:
	print(n // 2)
	p = []
	for i in range(n // 2):
		p.append(2)
else:
	print(n // 2)
	p = []
	for i in range(n // 2):
		p.append(2)
	p[-1] = 3
for i in range(len(p)):
	res = res + str(p[i]) + ' '
print(res)


n = int(input())
ans = int(n / 2)
a = []
for i in range(ans):
	a.append('2')
if n % 2 != 0:
	a[ans - 1] = str(int(a[ans - 1]) + 1)
print(ans)
print(' '.join(a))


n = int(input())
if n % 2 == 0:
	string = ' 2 ' * (n // 2)
	string = string.strip()
	ln = n // 2
else:
	string = ' 2' * (n // 2 - 1) + ' 3 '
	string = string.strip()
	ln = n // 2
print(ln)
print(string)


def bahgold(n):
	summand = []
	if n % 2 == 0:
		summand = [2 for i in range(int(n / 2))]
	else:
		summand = [2 for i in range(int((n - 3) // 2))]
		summand.append(3)
	print(len(summand))
	print(' '.join(map(str, summand)))
n = int(input())
bahgold(n)


n = int(input())
if n % 2 == 0:
	k = int(n / 2)
	print(k)
	print('2 ' * k)
else:
	n -= 3
	k = int(n / 2)
	print(k + 1)
	print('2 ' * k, end='')
	print('3')


n = int(input())
f = []
while n > 1:
	n = n - 2
	f.append(2)
l = len(f)
if n == 1:
	f[l - 1] = 3
print(len(f))
print(*f)


n = int(input())
print(n // 2)
print('2 ' * ((n - 2) // 2) + str(2 + n % 2))


enter_num = int(input())
count = 0
ans = ''
while enter_num > 0:
	if enter_num != 3:
		enter_num -= 2
		ans += '2 '
		count += 1
	else:
		enter_num -= 3
		ans += '3'
		count += 1
print(count)
print(ans)


number = int(input())
if number % 2 == 0:
	print(number // 2)
	print('2 ' * (number // 2))
else:
	print(number // 2)
	print('2 ' * (number // 2 - 1), end='')
	print('3')


n = int(input())
sum_ = [2] * (n // 2)
if n % 2 == 1:
	sum_[-1] = 3
print(len(sum_))
print(*sum_)


a = int(input())
b = []
c = 0
while 0 != a:
	if a != 3:
		a -= 2
		b.append(2)
		c += 1
	else:
		a -= 3
		b.append(3)
		c += 1
print(c)
for i in b:
	print(i, end=' ')


x = int(input())
y = x // 2
print(y)
if y * 2 == x:
	print(y * '2 ')
else:
	c = x % 2
	print((y - 1) * '2 ', c + 2)


import math

def solution():
	n = int(input())
	x = math.floor(n / 2)
	print(x)
	if n == 2:
		print('2')
	elif n == 3:
		print('3')
	elif n % 2 == 1:
		for i in range(0, x - 1):
			(print('2', end=' '),)
		print('3')
	elif n % 2 == 0:
		for i in range(0, x - 1):
			(print('2', end=' '),)
		print('2')
solution()


n = int(input())
print(n // 2)
s = '2 '
if n % 2 == 0:
	print(s * (n // 2))
else:
	print(s * ((n - 3) // 2) + '3')


n = int(input())
count = 0
lst = []
if n % 2 == 0:
	count += n // 2
	for _ in range(count):
		lst.append(2)
else:
	count += n // 2
	for _ in range(count - 1):
		lst.append(2)
	lst.append(3)
print(count)
print(*lst)


a = input()
num = int(a)
if num % 2 == 0:
	x = num // 2
	print(x)
	while x > 0:
		print(2, end=' ')
		x = x - 1
else:
	x = (num - 3) // 2
	print(x + 1)
	while x > 0:
		print(2, end=' ')
		x = x - 1
	print(3, end=' ')


a = int(input())
print(a // 2)
q = []
while a > 0:
	if a == 3:
		q.append('3')
		break
	else:
		a -= 2
		q.append('2')
b = ' '.join(q)
print(b)


n = int(input())
list = []
while n:
	if n - 2 > 1 or n - 2 == 0:
		list.append(2)
		n = n - 2
	else:
		list.append(3)
		n = n - 3
print(len(list))
print(*list)


n = int(input())
res = ''
if n % 2 == 1:
	res += '3 '
	n -= 3
for i in range(n // 2):
	res += '2 '
print(len(res) // 2)
print(res)


class prime_numbers:

	def __init__(self, number):
		self.number = number

	def prime_number_count(self):
		print(self.number // 2)

	def prime_numbers_in_number(self):
		if self.number % 2 == 0:
			print('2 ' * (self.number // 2))
		else:
			print('2 ' * (self.number // 2 - 1) + '3')
ans = prime_numbers(int(input()))
ans.prime_number_count()
ans.prime_numbers_in_number()


num = int(input())

def extract(num):
	print(num // 2)
	while num >= 4:
		print('2', end=' ')
		num -= 2
	print(num)
extract(num)


import math
x = int(input())
if x % 2 == 0:
	print(x // 2)
	a = x // 2 * '2'
	print(' '.join(a))
else:
	print(math.floor(x / 2))
	b = (math.floor(x / 2) - 1) * '2' + '3'
	print(' '.join(b))


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print((str(2) + ' ') * (n // 2))
if n % 2 == 1:
	print((n - 3) // 2 + 1)
	print((str(2) + ' ') * ((n - 3) // 2) + str(3))


n = int(input())
print(str(n // 2) + '\n' + str([2] * (n // 2 - 1) + [3] if n % 2 == 1 else [2] * (n // 2)).replace('[', '').replace(']', '').replace(',', ''))


def init():
	vis = [True] * 101
	vis[0] = vis[1] = 0
	for i in range(2, 101, 1):
		if vis[i]:
			for j in range(i + i, 101, i):
				vis[j] = 0
	for i in range(0, 101, 1):
		if vis[i]:
			print(i, end=' ')
a = int(input())
k = a // 2
print(k)
for i in range(k - 1):
	print(2, end=' ')
print(a % 2 + 2)


k = int(input())
print(k // 2)
print(' '.join(['2'] * (k // 2 - (k & 1))), '3' if k & 1 else '')


x = int(input())
if x % 2 == 0:
	print(int(x / 2))
	for i in range(int(x / 2)):
		print(2, end=' ')
else:
	ch = ''
	print(x // 2)
	ch += (x // 2 - 1) * '2 '
	ch += '3'
	print(ch)


import math
n = int(input())
if n % 2 == 0:
	m = int(n / 2)
	print(m)
	for x in range(0, m):
		print(2, end='')
		if x != m - 1:
			print(' ', end='')
	print()
elif n > 2:
	n -= 3
	m = int(n / 2)
	print(m + 1)
	for x in range(0, m):
		print(2, end='')
		print(' ', end='')
	print(3)


n = int(input())
if n % 2 == 0:
	ans = n // 2
	print(ans)
	print('2 ' * ans)
else:
	ans = (n - 3) // 2
	print(ans + 1)
	print('2 ' * ans, end='')
	print('3')


n = int(input())
print(n // 2)
if n % 2 == 1:
	print(3, end=' ')
	n -= 3
else:
	print(2, end=' ')
	n -= 2
for _ in range(n // 2):
	print(2, end=' ')


n = int(input())
answer = 0
numbers = []
if n % 2 == 0:
	while n:
		n -= 2
		numbers.append(str(2))
		answer += 1
else:
	while n > 3:
		n -= 2
		numbers.append(str(2))
		answer += 1
	if n == 3:
		n -= 3
		numbers.append(str(3))
		answer += 1
print(answer)
print(' '.join(numbers))


def populate(c, x):
	for i in range(c):
		numbers.append(x)
n = int(input())
primes = [2, 3]
numbers = []
count = 0
if n % 2 == 0:
	count = n // 2
	populate(count, 2)
else:
	count = n // 2
	count -= 1
	populate(count, 2)
	count += 1
	numbers.append(3)
print(count)
for i in numbers:
	print(i, end=' ')


n = int(input())
if n % 2 == 0:
	print(n // 2)
	string = '2 ' * (n // 2)
	print(string.rstrip(' '))
else:
	print(n // 2)
	string = '2 ' * (n // 2 - 1) + '3'
	print(string)


n = int(input())
ans = [2] * (n // 2)
if n % 2 != 0:
	ans[0] += 1
print(len(ans))
print(' '.join(map(str, ans)))


def main():
	n = int(input())
	k = 0
	if n % 2 == 0:
		k = int(n / 2)
		numbers = ['2'] * k
	else:
		numbers = ['3']
		n -= 3
		k = int(n / 2)
		numbers += ['2'] * k
		k += 1
	print(k)
	print(' '.join(numbers))
main()


n = int(input())
a = [2, 3, 5, 7, 11, 13, 17]
array = []
while n > 0:
	for i in a:
		if n - i >= 0 and n - i != 1:
			array += [i]
			n -= i
			break
print(len(array))
for i in array:
	print(i, end=' ')


def prime(a):
	i = 2
	while i ** 2 + 1 <= a:
		if a % i:
			return False
	return True
n = int(input())
ans = []
i = 2
while max(0, n - i + 1):
	if prime(i):
		ans.append(i)
		n -= i
if n:
	ans[-1] = 3
print(len(ans))
print(' '.join([str(i) for i in ans]))


import math
num = int(input())
if num % 2 == 0:
	print(int(num / 2))
	times = int(num / 2)
	while times > 0:
		print(2, end=' ')
		times = times - 1
else:
	print(math.ceil(num / 2) - 1)
	times = math.ceil(num / 2) - 1
	while times > 1:
		print(2, end=' ')
		times = times - 1
	print(3, end=' ')


n = int(input())
a = [0] * 100001
a[2] = 1
a[3] = 1
for i in range(3, n + 1):
	last = a[i - 2]
	a[i] = last + 1
if n % 2 == 0:
	two = a[n]
	twos = ['2'] * a[n]
	twos = ' '.join(twos)
	print(a[n])
	print(twos)
else:
	two = a[n]
	twos = ['2'] * (a[n] - 1)
	twos = ' '.join(twos)
	print(a[n])
	print(twos + ' 3')


def ok(n):
	if n % 2 == 0:
		print('2 ' * (n // 2))
		exit()
	else:
		print('2 ' * (n // 2 - 1) + '3')
		exit()
n = int(input())
print(n // 2)
print(ok(n))


f = int(input())
divisions = int(f / 2)
reminder = int(f % 2)
number = ''
for i in range(divisions - 1):
	number = number + '2 '
if reminder == 0:
	print(divisions)
	print(number + '2')
else:
	print(divisions)
	print(number + '3')


n = int(input())
div = n // 2
mod = n % 2
if mod == 0:
	ans = [2] * div
else:
	a = n - 2 * (div - 1)
	ans = [2] * (div - 1) + [a]
print(len(ans))
print(*ans)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math

def bin1(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = k ** mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin1(mid + 1, r, k, t, b, val, ans)
		else:
			return bin1(l, mid - 1, k, t, b, val, ans)

def bin2(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = t * k ** mid + b * mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin2(l, mid - 1, k, t, b, val, ans)
		else:
			return bin2(mid + 1, r, k, t, b, val, ans)

def SieveOfEratosthenes(n):
	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
	l = []
	for i in range(2, n + 1):
		if prime[i]:
			l.append(i)
	return l

def bin(l, r, ll, val):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if val >= ll[mid][0] and val <= ll[mid][1]:
			return mid
		elif val < ll[mid][0]:
			return bin(l, mid - 1, ll, val)
		else:
			return bin(mid + 1, r, ll, val)

def deci(n):
	s = ''
	while n != 0:
		if n % 2 == 0:
			n = n // 2
			s = '0' + s
		else:
			n = n // 2
			s = '1' + s
	return s

def diff(s1, s2):
	if len(s1) < len(s2):
		v = len(s1)
		while v != len(s2):
			s1 = '0' + s1
			v = v + 1
	else:
		v = len(s2)
		while v != len(s1):
			s2 = '0' + s2
			v = v + 1
	c = 0
	for i in range(len(s1)):
		if s1[i:i + 1] != s2[i:i + 1]:
			c = c + 1
	return c
from sys import stdin, stdout

def fac(a, b):
	v = a
	while a != b:
		v *= a - 1
		a = a - 1
	return v

def bino(l, r, n):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		val1 = math.log(n / mid + 1, 2)
		val2 = int(val1)
		if val1 == val2:
			return val1
		elif val1 < 1.0:
			return bino(l, mid - 1, n)
		else:
			return bino(mid + 1, r, n)

def binary(l, r, ll, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		if ll[mid] <= val:
			ans = mid
			return binary(mid + 1, r, ll, val, ans)
		else:
			return binary(l, mid - 1, ll, val, ans)
n = int(stdin.readline())
l = []
if n % 2 == 0:
	for i in range(n // 2):
		l.append(2)
	print(len(l))
	print(*l)
else:
	for i in range((n - 3) // 2):
		l.append(2)
	l.append(3)
	print(len(l))
	print(*l)


n = int(input())
list = []
if n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2)):
		print(2, end=' ')
elif n == 3:
	print(1)
	print(3)
else:
	print(int((n - 1) / 2))
	for i in range(int((n - 3) / 2)):
		list.append(2)
	list.append(3)
	for i in list:
		print(i, end=' ')


n = int(input())
if n % 2:
	print(1 + (n - 3) // 2)
	ans = [3]
	n -= 3
	while n:
		ans.append(2)
		n -= 2
else:
	print(n // 2)
	ans = [2]
	n -= 2
	while n:
		ans.append(2)
		n -= 2
print(' '.join(map(str, ans)))


n = int(int(input()))
if n % 2 == 0:
	print(n // 2)
	print(n // 2 * '2 ')
elif n == 3:
	print('1\n3')
else:
	print(n // 2)
	print((n - 3) // 2 * '2 ' + '3')


import sys
from collections import defaultdict

def stdinWrapper():
	data = '9\n\n'
	for line in data.split('\n'):
		yield line
if '--debug' not in sys.argv:

	def stdinWrapper():
		while True:
			yield input()
inputs = stdinWrapper()

def inputWrapper():
	return next(inputs)

def getType(_type):
	return _type(inputWrapper())

def getArray(_type):
	return [_type(x) for x in inputWrapper().split()]
n = getType(int)

def getForEven(n):
	return ['2'] * (n // 2)

def getForOdd(n):
	return getForEven(n - 3) + ['3']
result = getForEven(n) if n % 2 == 0 else getForOdd(n)
print(len(result))
print(' '.join(result))


x = int(input())
if x % 2 == 0:
	print(int(x / 2))
	for _ in range(int(x / 2)):
		print(2, end=' ')
else:
	print(int((x - 1) / 2))
	for _ in range(int((x - 1) / 2 - 1)):
		print(2, end=' ')
	print(3, end=' ')


n = eval(input())
a = n % 2
b = n // 2
if a == 0:
	print(b)
	list = [2] * b
	print(' '.join(map(str, list)))
else:
	print(b)
	list = [2] * (b - 1) + [3]
	print(' '.join(map(str, list)))


n = int(input())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print(2, end=' ')
else:
	print((n - 3) // 2 + 1)
	p = ((n - 3) // 2 + 1) * [0]
	p[-1] = 3
	for i in range((n - 3) // 2):
		p[i] = 2
	for i in range(len(p)):
		print(p[i], end=' ')


n = int(input())
count = 0
list = []
while n > 0:
	if n % 2 == 0:
		while n > 0:
			n = n - 2
			count = count + 1
			list.append(2)
	else:
		n = n - 3
		count = count + 1
		list.append(3)
print(count)
print(' '.join((str(e) for e in list)))


n = int(input())
a = int(n / 2)
b = n % 2
if b:
	a -= 1
print(a + b)
for i in range(a):
	print('2', end=' ')
if b:
	print('3')


p = int(input())
ans1 = 0
ans2 = ''
while p != 2 and p != 3:
	p -= 2
	ans1 += 1
	ans2 += '2'
	ans2 += ' '
print(ans1 + 1)
ans2 += str(p)
print(ans2)


from sys import stdin

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

def si():
	return stdin.readline()

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

def li():
	return list(mi())
n = ii()
p = n // 2
a = [2] * p
a[p - 1] += n % 2
print(p)
print(*a)


n = int(input())
a = []
while n > 1:
	n -= 2
	a.append('2')
else:
	if n == 1:
		a[len(a) - 1] = '3'
print(len(a))
print(' '.join(a))


import sys
n = int(sys.stdin.readline())
k = n // 2
print(k)
if n % 2 == 0:
	print('2 ' * k)
else:
	print('2 ' * (k - 1) + '3')


try:
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2))
		for i in range(int(n / 2)):
			print(2, end=' ')
	else:
		print(int(n / 2))
		for i in range(1, int(n / 2)):
			print(2, end=' ')
		print(3, end=' ')
except Exception:
	pass


a = int(input())
res = ''
temp = 0
br = 0
while temp < a:
	res = res + '2 '
	temp = temp + 2
	br += 1
if a == temp:
	print(br)
	print(res[:-1])
else:
	print(br - 1)
	print(res[:-4] + '3')


n = int(input())
solution = []
if n % 2 == 0:
	print(int(n / 2))
	for i in range(0, n, 2):
		print('2 ', end='')
else:
	for i in range(0, n - 1, 2):
		solution.append('2')
	solution[-1] = '3'
	print(len(solution))
	print(' '.join(solution))


def sieve(n):
	isprime = [True] * (n + 1)
	isprime[1] = False
	for i in range(2, int(n ** 0.5) + 1):
		if isprime[i] == True:
			for j in range(2 * i, n + 1, i):
				isprime[j] = False
	return [str(x) for x in range(2, n + 1) if isprime[x]]
n = int(input())
prime_l = sieve(n)
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print(2, end=' ')
else:
	print((n - 3) // 2 + 1)
	for i in range((n - 3) // 2):
		print(2, end=' ')
	print(3, end=' ')


import sys
a = int(next(sys.stdin).strip())
print(a // 2)
b = [2 for _ in range(a // 2)]
if a % 2 == 1:
	b[0] = 3
print(' '.join(map(str, b)))


n = int(input())
if n % 2 == 0:
	print('%d' % (n // 2))
	print(*[2] * (n // 2))
	exit()
n -= 3
print('%d' % (n // 2 + 1))
print('3', *[2] * (n // 2))


a = int(input())
print(a // 2)
while a > 0:
	if a == 3:
		print(3)
		break
	else:
		print(2)
		a -= 2


t = int(input())
if t % 2 == 0:
	print(t // 2)
	k = [2] * (t // 2)
	print(*k)
else:
	print(t // 2)
	k = [2] * (t // 2 - 1)
	l = [3] * 1
	print(*k + l)


n = int(input())
line = []
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		line += [2]
else:
	print(n // 2)
	for i in range(n // 2 - 1):
		line += [2]
	line += [3]
print(' '.join(map(str, line)))


n = int(input())
tot = 0
if n in [2, 3]:
	tot = 1
else:
	tot = n // 2 if not n % 2 else (n - 3) // 2 + 1
print(tot)
if n % 2:
	print('2 ' * (tot - 1), end='')
	print('3')
else:
	print('2 ' * tot, end='')


n = int(input())
res = str()
if n % 2:
	res = f"{'2 ' * ((n - 3) // 2)}3"
else:
	res = '2 ' * (n // 2)
print(len(res.replace(' ', '')))
print(res.strip())


def printer(x, three):
	for i in range(x):
		print('2', end=' ')
	if three:
		print('3')
n = int(input())
if n % 2 != 0:
	x = (n - 3) // 2
	print(x + 1)
	printer(x, True)
else:
	x = n // 2
	print(x)
	printer(x, False)


num = int(input())
dos = 0
tres = 0
if num % 2 == 0:
	dos = int(num / 2)
else:
	dos = int(num / 2) - 1
	tres = 1
print(dos + tres)
print('2 ' * dos + '3' * tres)


def primt(n, j):
	while n > 1:
		if n == 3:
			j = j + ' ' + str(3)
			return j
		elif n == 2:
			j = j + ' ' + str(2)
			return j
		else:
			j = j + ' ' + str(2)
			n = n - 2
	return j
n = int(input())
count = 0
j = ''
f = primt(n, j)
p = f.split()
p = len(p)
print(p)
print(f[1:])


inp = int(input())
if inp % 2 == 0:
	print(inp // 2)
	print('2 ' * (inp // 2))
else:
	print((inp - 1) // 2)
	print('2 ' * ((inp - 1) // 2 - 1) + '3 ')


n = int(input())
if n % 2 == 0:
	arr = [2] * int(n / 2)
else:
	arr = [3]
	if n - 3 > 0:
		arr2 = [2] * int((n - 3) / 2)
		arr += arr2
print(len(arr))
print(*arr)


import pdb
n = int(input())
if n == 1:
	print(1)
	print(1)
elif n % 2 == 0:
	print(n // 2)
	print(f"{n // 2 * ' 2'} ")
elif n % 2 != 0:
	x = n - 3
	print(x // 2 + 1)
	print(f"{x // 2 * ' 2'} {3}")


n = int(input())
ans = [2] * (n // 2)
if n % 2:
	ans[-1] = 3
print(len(ans))
print(*ans)


import math, fractions
n = int(input())
c2 = n // 2
if n % 2 == 0:
	print(c2)
	print('2 ' * c2)
else:
	print(c2)
	print('2 ' * (c2 - 1) + '3')


x = int(input())
n = x // 2
print(str(n))
res = ''
for _ in range(n - 1):
	res += '2 '
if x % 2 == 0:
	res += '2'
else:
	res += '3'
print(res)


from sys import exit as sys_ret
from sys import stdin, stdout
size = int(stdin.readline())
amount = size // 2
stdout.write(str(amount) + '\n')
stdout.flush()
amount -= 1
while amount:
	amount -= 1
	stdout.write('2 ')
	stdout.flush()
stdout.write('2' if size % 2 == 0 else '3')
stdout.flush()


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	for n in range(1, int(1 + n / 2)):
		print('2', end=' ')
elif n % 2 == 1:
	print(int((n - 1) / 2))
	print('3', end=' ')
	for a in range(1, 1 + int((n - 3) / 2)):
		print('2', end=' ')


k = int(input())
f = 0
f2 = 0
while k >= 2:
	if k % 2 == 0:
		k -= 2
		f += 1
	else:
		k -= 3
		f2 += 1
print(f + f2)
for i in range(0, f):
	print(2, end=' ')
for i in range(0, f2):
	print(3, end=' ')


n = int(input())
n_t = 0
while n > 3:
	n -= 2
	n_t += 1
if n == 3:
	print(str(n_t + 1) + '\n3', end=' ')
	for _ in range(n_t):
		print('2', end=' ')
else:
	print(n_t + 1)
	for _ in range(n_t + 1):
		print('2', end=' ')


def goldbach(n):
	if n % 2 == 0:
		return [2] * (n // 2)
	else:
		return [2] * (n // 2 - 1) + [3]
n = int(input())
a = goldbach(n)
print(len(a))
print(*a)


n = int(input())
ans = n // 2
s = '2 ' * (n // 2 - 1)
s += str(2 + n % 2)
print(ans)
print(s)


n = int(input())
print(str(n // 2), '2 ' * (n // 2) if n % 2 == 0 else '2 ' * (n // 2 - 1) + '3', sep='\n')


n = int(input())
if n % 2 == 0:
	ans = ['2'] * (n // 2)
	print(n // 2)
	print(' '.join(ans))
elif n % 2 == 1:
	ans = ['2'] * (n // 2 - 1) + ['3']
	print(n // 2)
	print(' '.join(ans))


x = int(input())
p = []
x1 = x
a = x // 2
print(a)
for i in range(int(a)):
	p.append('2')
if x1 % 2 == 0:
	for i in p:
		print(i, '', end='')
else:
	k = int(p[-1]) + 1
	del p[-1]
	for i in p:
		print(i, '', end='')
	print(k)


n = int(input())
out = []
if n % 2:
	n -= 3
	out.append(3)
out += [2] * (n // 2)
print(len(out))
print(*out)


n = int(input())
print(int(n / 2))
plist = ['2' for _ in range(int(n / 2) - 1)]
plist.append('3' if n % 2 == 1 else '2')
print(' '.join(plist))


n = int(input())
if n % 2 == 0:
	count = int(n / 2)
	ans = [2 for _ in range(count)]
	print(count)
	print(*ans)
else:
	count_two = int(n / 2) - 1
	ans = [2 for _ in range(count_two)]
	ans.extend([3])
	print(count_two + 1)
	print(*ans)


n = int(input())
a = 0
q = list()
if n == 3:
	print(1)
	print(3)
	exit(0)
if n % 2 == 1:
	n = n - 1
	a = int(n / 2)
	n = n + 1
	for i in range(a):
		q.append(2)
		n -= 2
		if n == 3:
			q.append(3)
			print(a)
			for i in q:
				print(i, end=' ')
			exit(0)
elif n % 2 == 0:
	a = int(n / 2)
	for i in range(a):
		q.append(2)
		n -= 2
		if n == 0:
			print(a)
			for i in q:
				print(i, end=' ')
			exit(0)


x = int(input())
counter = 0
ans = []
while not x == 0:
	if x - 2 > 1:
		x -= 2
		counter += 1
		ans.append('2')
	elif x - 2 == 0:
		x -= 2
		counter += 1
		ans.append('2')
	else:
		x -= 3
		counter += 1
		ans.append('3')
print(counter)
print(' '.join(ans))


n = int(input())
if n % 2 == 1:
	a = n // 2
	print(str(a) + '\r')
	print('2 ' * (a - 1) + '3')
else:
	a = n // 2
	print(str(a) + '\r')
	print('2 ' * a)


from sys import stdin, stdout

def main():
	n = int(stdin.readline())
	stdout.write(str(n // 2))
	stdout.write(str('\n'))
	stdout.write(str('2 ' * (n // 2 - 1)))
	if n % 2 == 0:
		stdout.write(str('2'))
	else:
		stdout.write(str('3'))
main()


n = int(input())
two_n = n // 2
if n % 2 == 0:
	print(two_n)
	print(' '.join('2' * two_n))
else:
	print(two_n)
	print(' '.join('2' * (two_n - 1) + '3'))


n = int(input())
(k, mod) = divmod(n, 2)
print(k)
print(' '.join('2' * (k - 1) + ('3' if mod else '2')))


a = int(input())
cnt = 0
d = 0
if a == 3:
	print(1)
	print(3)
if a % 2 == 0:
	print(a // 2)
	for i in range(a // 2):
		cnt += 2
		if cnt <= a:
			print('2', end=' ')
elif a % 2 != 0 and a > 3:
	print(a // 2)
	for i in range(a // 2):
		d += 2
		if d <= a - 3:
			print('2', end=' ')
		else:
			d += 3
			print('3', end=' ')


nr = int(input())
par = False
n = nr % 2
k = nr // 2
if n == 0:
	par = True
if par:
	print(k)
	rasp = ''
	for i in range(k):
		rasp += '2'
else:
	print(k)
	rasp = '3'
	for i in range(k - 1):
		rasp += '2'
final = ''
for each in rasp:
	final += each
	final += ' '
print(final[:-1])


n = int(input())
count = 0
count2 = 0
while n > 0:
	if n == 3:
		n -= 3
		count2 += 1
	else:
		n -= 2
		count += 1
print(count + count2)
for i in range(count):
	print(2, end=' ')
if count2:
	print(3)


n = int(input())
s = [2] * (n // 2 - 1) + [2 + n % 2]
print(len(s))
print(' '.join(map(str, s)))


n = int(input())
print(n // 2)
while n > 3:
	print('2', end=' ')
	n = n - 2
if n % 2 == 0:
	print('2')
else:
	print('3')


n = int(input())
quo = n // 2
l = [2 for i in range(quo - 1)]
if n % 2 == 0:
	l.append(2)
else:
	l.append(3)
print(quo)
for i in l:
	print(i, end=' ')


x = int(input())
y = x / 2
u = '2'
y = int(y)
u = '2'
up = x - 3
down = up / 2
down = int(down)
if x % 2 == 0:
	print(int(y))
	print(*u * y, sep=' ')
else:
	print(down + 1)
	print(*u * down, 3, sep=' ')


n = int(input())
l = []
if n % 2 == 0:
	c = n // 2
	l = [2 for i in range(0, n, 2)]
else:
	c = n // 2
	n = n - 3
	l = [2 for i in range(n // 2)]
	l.append(3)
print(c)
print(*l)


n = int(input())
k3 = n % 2
k2 = 1 if n == 2 else (n - 3 * k3) // 2
print(k2 + k3)
for i in range(k2):
	print(2, end=' ')
if k3:
	print(3, end='')
print()


n = int(input())
mod = n % 2
bolum = int(n / 2)
if mod == 1:
	print('{}\n'.format(int(n / 2)))
	print('2 ' * (bolum - 1) + '3')
else:
	print('{}\n'.format(int(n / 2)))
	print('2 ' * bolum)


import sys
line = int(sys.stdin.readline().strip())
number = line // 2
res = []
if line % 2 == 0:
	res = map(str, [2] * number)
else:
	res = map(str, [2] * (number - 1) + [3])
print(number)
print(' '.join(res))


a = int(input())
count = 0
if a % 2 == 0:
	count = a // 2
	q = [2] * count
	print(len(q))
	print('2 ' * count)
else:
	a = a - 3
	count = a // 2
	q = [2] * count
	q.append(3)
	print(len(q))
	print('2 ' * count + '3')


n = int(input())
a = []
x = n
while x != 3 and x > 0:
	x -= 2
	a.append(2)
if x == 3:
	a.append(3)
print(len(a))
print(*a)


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


n = int(input())
x = n // 2
res = []
for i in range(x - 1):
	res.append(2)
if n % 2 == 0:
	res.append(2)
else:
	res.append(3)
print(len(res))
for i in res:
	print(i, end=' ')


a = int(input())
if a % 2 == 0:
	l = []
	for i in range(a // 2):
		l.append(2)
else:
	l = [3]
	for i in range(a // 2 - 1):
		l.append(2)
print(len(l))
print(*l)


def solve():
	n = int(input())
	if n == 2:
		return '1\n2'
	res = []
	if n % 2 == 1:
		res.append('3')
		n -= 3
	res += ['2'] * (n // 2)
	return str(len(res)) + '\n' + ' '.join(res)
print(solve())


number = int(input())
if number % 2 == 0:
	answer = number // 2
	new_list = [2] * answer
	print(len(new_list))
	print(*new_list)
elif number % 2 == 1:
	number = number - 3
	answer = number // 2
	new_list = [2] * answer
	new_list.append(3)
	print(len(new_list))
	print(*new_list)


n = int(input())
ans = []
while n:
	if n > 3:
		ans.append(2)
		n -= 2
	else:
		ans.append(n)
		break
print(len(ans))
print(*ans)


n = int(input())
threes = twos = 0
if n % 2 != 0:
	threes = 1
	n -= 3
	twos += int(n / 2)
else:
	twos = int(n / 2)
print(twos + threes)
print(('2 ' * twos).strip(), '3' * threes)


n = int(input())
twos = 0
threes = 0
if n % 2 == 0:
	twos = int(n / 2)
else:
	twos = int(n / 2) - 1
	threes = 1
print(twos + threes)
for x in range(twos):
	print(2, end=' ')
for x in range(threes):
	print(3, end=' ')
print()


t = int(input())
if t % 2 == 0 and t > 3:
	print(t // 2)
	print(*[int(2) for i in range(t // 2)])
elif t == 2:
	print(1)
	print(2)
else:
	print(1 + (t - 3) // 2)
	print('3', *[int(2) for i in range((t - 3) // 2)])


a = int(input())
print(a // 2)
if a % 2 == 0:
	print(' '.join(['2'] * (a // 2)))
else:
	d = a // 2 - 1
	print(' '.join(['2'] * d + ['3']))


n = int(input())
q = n // 2 - 1
s1 = '2 ' * q
if n - q * 2 == 3:
	s1 += '3'
elif n - q * 2 == 2:
	s1 += '2'
print(n // 2)
print(s1)


n = int(input())
s = []
(twos, threes) = (0, 0)
if n % 2 == 0:
	s = [2] * (n // 2)
else:
	s = [2] * ((n - 3) // 2)
	s.append(3)
print(len(s))
for div in s:
	print(div, end=' ')


n = int(input())
if n % 2 == 1:
	c = n - 3
	print(1 + c // 2)
	print('2 ' * (c // 2), '3', sep='')
else:
	print(n // 2)
	print('2 ' * (n // 2))


n = int(input())
prime_number = 0
primes = []
while n != 0:
	if n % 2 == 0:
		n = n - 2
		prime_number += 1
		primes.append(2)
	else:
		n = n - 3
		prime_number += 1
		primes.append(3)
primes.sort()
print(prime_number)
for item in primes:
	print(item, end=' ')


getal = int(input())
if getal % 2 == 0:
	aantal = getal // 2
	print(aantal)
	print('2 ' * (aantal - 1) + '2')
else:
	aantal_drie = 1
	aantal_twee = (getal - 3) // 2
	print(aantal_twee + aantal_drie)
	print('2 ' * aantal_twee + '3')


from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
ai = lambda : list(map(int, stdin.readline().split()))
ei = lambda : map(int, stdin.readline().split())
ip = lambda : int(stdin.readline().strip())

def seive(n, li):
	prime = [True for i in range(n + 1)]
	prime[0] = prime[1] = False
	for i in range(2, int(math.sqrt(n)) + 1):
		if prime[i]:
			for j in range(i * i, n + 1, i):
				prime[j] = False
	for i in range(n + 1):
		if prime[i]:
			li.append(i)
	return li
n = ip()
if ~n & 1:
	print(n // 2)
	print(*n // 2 * [2])
else:
	print(n // 2)
	print(*(n // 2 - 1) * [2] + [3])


n = int(input())
a = []
while n > 1:
	print(n // 2)
	if n % 2 == 0:
		for i in range(n // 2):
			a.append(2)
			n = n // 2
	else:
		while n != 3:
			a.append(2)
			n = n - 2
		a.append(3)
		n -= 3
	print(*a)


n = int(input())
t = []
if n % 2 == 0:
	a = n // 2
	b = [2] * a
	print(len(b))
	print(*b)
else:
	c = n - 3
	d = c // 2
	e = [2] * d + [3]
	print(len(e))
	print(*e)


n = int(input())
if n % 2 == 1:
	n2 = n // 2 - 1
	n3 = 1
if n % 2 == 0:
	n2 = n // 2
	n3 = 0
print(n2 + n3)
array = [2] * n2 + [3] * n3
print(*array)


i = int(input())
if i % 2 == 0:
	print(i // 2)
	res = ''
	for j in range(i // 2):
		res += '2 '
else:
	print((i - 3) // 2 + 1)
	res = ''
	for j in range((i - 3) // 2):
		res += '2 '
	res += '3 '
print(res[:-1])


n = int(input())
a = []
i = 2
k = 2
while n > 0:
	if n - n // i * i != 1:
		for j in range(n // i):
			a.append(i)
		n -= n // i * i
	else:
		for j in range(n // i - 1):
			a.append(i)
		n -= (n // i - 1) * i
	b = i
	while True:
		b += 1
		ans = 'p'
		j = 1
		while j * j <= n:
			j += 1
			if b % j == 0:
				ans = 'c'
				break
		if n == 2:
			ans = 'p'
		if ans == 'p':
			i = b
			break
	if i >= n and n != 0:
		a.append(n)
		break
print(len(a))
ans = ''
for i in a:
	ans += str(i) + ' '
print(ans)


F = lambda : int(input())
n = F()
if n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
else:
	print(n // 2)
	print('2 ' * (n // 2 - 1) + '3')


n = int(input())
count2 = 0
count3 = 0
if n & 1:
	count3 += 1
	n -= 3
count2 = n / 2
print(int(count2 + count3))
for i in range(int(count2)):
	print(2, end=' ')
if count3 == 1:
	print(3)


def main():
	try:
		while True:
			n = int(input())
			ls = []
			if n & 1:
				ls.append('3')
				n -= 3
			while n:
				ls.append('2')
				n -= 2
			print(len(ls))
			print(' '.join(ls))
	except EOFError:
		pass
main()


N = int(input())
print(N // 2)
print('2 ' * (N // 2 - 1), sep=' ', end='')
if N & 1:
	print(3)
else:
	print(2)


n = int(input(''))
output = ''
if n % 2 == 0:
	for k in range(1, int((n + 2) / 2)):
		output = output + '2' + ' '
else:
	for k in range(1, int((n - 1) / 2)):
		output = output + '2' + ' '
	output = output + '3'
j = int(n / 2)
print(j)
print(output)


n = int(input())
if n % 2 == 1:
	n = n - 1
	print(int(n / 2))
	twos = int(n / 2) - 1
	ls = [2 for i in range(twos)]
	ls.append(3)
	print(*ls)
else:
	twos = int(n / 2)
	print(twos)
	ls = [2 for i in range(twos)]
	print(*ls)


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

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

def si():
	return str(input())

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

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

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

def fsi():
	return str(stdin.readline())

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

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

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

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)
n = ii()
if n % 2 == 0:
	l = ['2' for i in range(n // 2)]
else:
	l = ['2' for i in range(n // 2 - 1)]
	l.append('3')
print(len(l))
print(' '.join(l))


n = int(input())
r = []
if n % 2:
	r.append('3')
	n -= 3
while n > 0:
	r.append('2')
	n -= 2
print(len(r))
print(' '.join(r))


n = int(input())
print(n // 2)
m = [2] * (n // 2 - 1)
m.append(2 + n % 2)
print(*m)


n = int(input())
even = n // 2
print(even)
if n % 2 == 1:
	even -= 1
for i in range(even):
	print(2, end=' ')
if n % 2 == 1:
	print(3)


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

def __starting_point():
	main()
__starting_point()


n = int(input())
if n % 2 == 0:
	ret = ['2'] * (n // 2)
	print(len(ret))
	print(' '.join(ret))
else:
	n -= 3
	ret = ['3'] + ['2'] * (n // 2)
	print(len(ret))
	print(' '.join(ret))


number = int(input())
l = []
counter = 0
while number >= 2:
	counter += 1
	if number == 3:
		l.append(3)
		number -= 3
	else:
		l.append(2)
		number -= 2
print(counter)
for index in l:
	print(str(index) + ' ', end='')


def pns(n):
	if n % 2:
		return (1, (n - 3) // 2)
	return (0, n // 2)

def pg(n):
	(t, d) = pns(n)
	for x in range(d):
		yield 2
	if t:
		yield 3
v = list(pg(int(input())))
print(len(v))
print(*v)


x = int(input())
if x % 2 == 0:
	print(x // 2)
	aas = '2 '
	a = '2'
	ans = aas * (x // 2 - 1) + a
	print(ans)
else:
	yo = x - 3
	aas = '2 '
	b = '3'
	ans = aas * (yo // 2) + b
	print(yo // 2 + 1)
	print(ans)


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split().strip())
M = lambda : map(int, input().split())
n = int(input())
k = n // 2
l = [2] * (k - n % 2)
l += [3] * int(bool(n % 2))
print(len(l))
print(*l)


x = int(input())
print(x // 2)
while x > 3:
	print(2, end=' ')
	x -= 2
print(x)


n = int(input())
v = []
for i in range(2, n + 1, 1):
	divisor = 0
	for k in range(2, int(pow(i, 1 / 2) + 1), 1):
		if i % k == 0:
			divisor += 1
			break
	if divisor == 0:
		v.append(i)
ans = 0
k = 0
ans2 = ''
for j in v:
	while k + j <= n and n - (k + j) != 1:
		ans += 1
		ans2 += str(j)
		k += j
		if k != n:
			ans2 += ' '
print(ans)
print(ans2)


n = int(input())
m = '2 ' * (n // 2)
if n % 2 == 0:
	print(n // 2, m, sep='\n')
else:
	m = m[:len(m) - 2] + '3'
	print(n // 2, m, sep='\n')


n = int(input())
print(n // 2)
res = list()
if n % 2:
	res = [3] + [2] * ((n - 3) // 2)
else:
	res = [2] * (n // 2)
print(*res)


n = int(input())
print(n // 2)
if not n % 2:
	c = '2 ' * (n // 2 - 1) + '2'
else:
	c = '2 ' * (n // 2 - 1) + '3'
print(c)


x = int(input())
if x % 2 == 0:
	print(int(x / 2))
	s = ' 2' * int(x / 2)
else:
	print(int((x - 1) / 2))
	s = int((x - 3) / 2) * ' 2' + ' 3'
s = s[1:]
print(s)


import math
n = int(input())
if n % 2 == 0:
	print(str(int(n / 2)) + ' ')
	j = math.floor(n / 2)
	for i in range(j):
		print(str(2), end=' ')
else:
	k = n - 3
	y = k / 2
	y1 = y + 1
	l = math.floor(y)
	print(str(int(y1)) + ' ')
	if l != 0:
		for i in range(l):
			print(str(2), end=' ')
	print(3)


a = int(input())
f = a // 2
s = str()
print(f)
if a % 2 == 0:
	for i in range(f):
		s = s + ' 2'
else:
	for i in range(f - 1):
		s = s + ' 2'
	s = s + ' 3'
print(s[1:])


x = int(input())
z = []
y = x
for i in range(x):
	if y > 0:
		if y == 3:
			z.append(3)
			y -= 3
		else:
			z.append(2)
			y -= 2
	else:
		break
print(len(z))
for i in z:
	print(i, end=' ')


n = int(input())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print(2, end=' ')
elif n == 3:
	print(1)
	print(3)
else:
	ans = []
	while n != 3:
		ans += [2]
		n -= 2
	ans += [3]
	print(len(ans))
	print(' '.join(map(str, ans)))


def solve():
	n = int(input())
	ans = []
	while n > 0:
		if n - 2 == 1:
			ans.append(3)
			n -= 3
		else:
			ans.append(2)
			n -= 2
	print(len(ans))
	print(*ans)
solve()


n = int(input())
counterArray = []
while n >= 1:
	if n % 2 == 0:
		n = n - 2
		counterArray.append(2)
	elif n % 2 == 1 and n > 2:
		n = n - 3
		counterArray.append(3)
print(len(counterArray))
print(' '.join([str(x) for x in counterArray]))


n = int(input())
numbers = []
if n % 2 != 0:
	numbers.append(3)
	n -= 3
for i in range(int(n / 2)):
	numbers.append(2)
print(len(numbers))
print(*numbers, sep=' ')


def answer():
	a = int(input())
	if a % 2 == 0:
		print(int(a / 2))
		print('2 ' * (int(a / 2) - 1) + '2')
	else:
		print(int(a / 2))
		print('2 ' * (int(a / 2) - 1) + '3')
answer()


n = int(input())
if int(n % 2) == 0:
	print(int(n / 2))
	ans = []
	for k in range(int(n / 2)):
		ans.append('2')
	print(*ans)
else:
	s = int(n / 2) - 1
	ans = []
	for k in range(s):
		ans.append('2')
	ans.append('3')
	print(s + 1)
	print(*ans)


n = int(input())
k = ''
p = '2'
if n % 2 != 0:
	n = n - 3
	k = '3'
if n % 2 == 0:
	p = p * (n // 2) + k
print(len(p))
print(' '.join(p))


from sys import stdin
_input = stdin.readline
_int = int

def solution():
	n = _int(_input())
	if n % 2 == 0:
		print(n // 2)
		print(*[2] * (n // 2))
	else:
		print((n - 3) // 2 + 1)
		print(*[2] * ((n - 3) // 2), 3)
solution()


a = int(input())
print(int(a / 2))
print(' '.join(['2'] * int((a - 3) / 2) + ['3']) if a % 2 else ' '.join(['2'] * int(a / 2)))


number = int(input())
List = []
counter = 0
for index in range(number, 1, -2):
	counter += 1
	if index == 3:
		List.append(3)
	else:
		List.append(2)
print(counter)
for index in List:
	print(str(index) + ' ', end='')


n = int(input())
print(n // 2)
if n % 2 == 0:
	print(' '.join(['2' for _ in range(n // 2)]))
else:
	print(' '.join(['2' for _ in range((n - 3) // 2)] + ['3']))


a = int(input())
z = 0
while True:
	if a - 2 == 0:
		print(z + 1)
		print('2 ' * z + '2')
		break
	if a - 3 == 0:
		print(z + 1)
		print('2 ' * z + '3')
		break
	a -= 2
	z += 1


n = int(input())
sch = 0
while n > 3:
	n -= 2
	sch += 1
print(sch + 1)
for i in range(sch):
	print(2, end=' ')
print(n)


printf = lambda x: print(x, end='')
i = int(input())
printf('%d\n' % (i // 2))
if i % 2 is not 0:
	printf('3 ')
	i -= 3
for j in range(i // 2):
	printf('2 ')


num = int(input())
(div, mod) = divmod(num, 2)
if mod == 0:
	print(div)
	print(' '.join(['2'] * div))
else:
	print(div)
	print(' '.join(['2'] * (div - 1)) + ' 3')


class Main:

	def __init__(self):
		n = int(input())
		if n % 2 == 0:
			k = int(n / 2)
			print(k)
			for i in range(k):
				print(2, end=' ')
		else:
			k = int((n - 3) / 2 + 1)
			print(k)
			for i in range(k - 1):
				print(2, end=' ')
			print(3)
Main()


n = int(input())
lis = []
lis += [2] * (n // 2)
if n % 2 == 1:
	lis[len(lis) - 1] += 1
print(len(lis))
print(*lis)


import time

def printResult(ct2, ct3):
	nstr = []
	for x2 in range(ct2):
		nstr.append('2')
	for x3 in range(ct3):
		nstr.append('3')
	print(len(nstr))
	print(' '.join(nstr))

def calculateMaxPrimes(num):
	isEven = num % 2
	ct2 = 0
	ct3 = 0
	if isEven > 0:
		ct2 = (num - 3) // 2
		ct3 = 1
	else:
		ct2 = num // 2
	printResult(ct2, ct3)

def solve():
	num = int(input())
	calculateMaxPrimes(num)
solve()


s = int(input())
if s % 2 == 0:
	r = s // 2
	print(r)
	for i in range(r):
		print(2, end=' ')
else:
	r = s // 2
	print(r)
	for i in range(r - 1):
		print(2, end=' ')
	print(3)


n = int(input())
arr = []
if n % 2 == 1:
	arr.append(3)
	n -= 3
while n != 0:
	arr.append(2)
	n -= 2
print(len(arr))
ans = ''
for x in arr:
	ans += str(x) + ' '
print(ans)


n = int(input())
print(n // 2)
ans1 = '2 ' * (n // 2 - 1) + '3'
ans2 = '2 ' * (n // 2)
print([ans1, ans2][n % 2 == 0])


n = int(input())
k = 0
temp = 2
numbers = []
while n > 0:
	if n % temp == 1:
		k += n // temp - 1
		actual = n // temp - 1
		for i in range(actual):
			numbers.append(temp)
			n -= temp
	else:
		k += n // temp
		actual = n // temp
		for i in range(n // temp):
			numbers.append(temp)
			n -= temp
	temp += 1
print(k)
print(*numbers)


n = int(input())
ans = [2 for i in range(n // 2)]
if n % 2:
	ans[-1] = 3
print(n // 2)
for x in ans:
	print(x, end=' ')


import sys
from bisect import bisect_left, bisect_right
from collections import deque, Counter
from math import gcd, sqrt, factorial, ceil, log
from itertools import permutations
inf = float('inf')
mod = 1000000007
mini = 1000000007

def fact(n):
	if n == 0:
		return 1
	p = 1
	d = 10 ** 9 + 7
	for i in range(1, n + 1):
		p = p * i
		p = p % d
	return p

def ncr(n, r):
	d = 10 ** 9 + 7
	num = fact(n)
	den = fact(r) * fact(n - r) % d
	den = pow(den, d - 2, d)
	return num * den % d

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

def binary(number):
	result = 0
	while number:
		result = result + 1
		number = number & number - 1
	return result

def calculate_factors(n):
	hh = [1] * (n + 1)
	p = 2
	while p * p < n:
		if hh[p] == 1:
			for i in range(p * 2, n, p):
				hh[i] = 0
		p += 1
	total = 1
	for p in range(2, n + 1):
		if hh[p] == 1:
			count = 0
			if n % p == 0:
				while n % p == 0:
					n = int(n / p)
					count += 1
				total *= count + 1
	return total

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())
print(n // 2)
result = []
if n & 1:
	a = n // 2 - 1
	for i in range(a):
		result.append(2)
	result.append(3)
else:
	a = n // 2
	for i in range(a):
		result.append(2)
print(*result, sep=' ')


n = int(input())
p = int(n / 2)
print(int(n / 2))
if n % 2 == 0:
	t = 0
	while t < p:
		print('2', end=' ')
		t = t + 1
if n % 2 == 1:
	t = 0
	while t < p - 1:
		print('2', end=' ')
		t = t + 1
	if t == p - 1:
		print('3')


n = int(input())
m = n // 2
print(m)
print(*[2] * (m - 1), 3 if n % 2 else 2)


N = int(input())
if N % 2 == 0:
	times = N / 2
	print(int(times))
	print('2 ' * int(times))
else:
	times = (N - 3) / 2
	print(int(times) + 1)
	print('2 ' * int(times) + '3 ')


n = int(input())
k = n // 2
print(k)
s = ' '.join(['2'] * (k - 1))
if n % 2:
	print(f'{s} 3')
else:
	print(f'{s} 2')


n = int(input())
value = n // 2
if n % 2 == 0:
	ans = '2' * value
	print(value)
	for i in ans:
		print(i, end=' ')
else:
	multiply = value - 1
	print(value)
	another = 2 * multiply
	forthree = value - multiply
	ans = '2' * multiply + '3' * forthree
	for i in ans:
		print(i, end=' ')


i = int(input())
print('%d' % (i // 2))
if i % 2 is not 0:
	print('3 ', end='')
	i -= 3
for j in range(i // 2):
	print('2 ', end='')


n = int(input())
s = []

def Print(s):
	for i in s:
		print(i, end=' ')
while n != 0:
	if n % 2 == 0:
		n = n - 2
		s.append(2)
	elif n % 2 == 1:
		n = n - 3
		s.append(3)
print(len(s))
Print(s)


n = int(input())
(cnt, out) = (0, '')
if n % 2 == 1:
	(n, cnt, out) = (n - 3, 1, '3 ')
print(str(cnt + n // 2))
print(out + ' '.join(['2' for _ in range(n // 2)]))


R = lambda : map(int, input().split())
n = int(input())
res = ['2'] * (n // 2 - n % 2) + (['3'] if n % 2 else [])
print(len(res))
print(' '.join(res))


primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891, 17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971, 17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059, 18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143, 18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233, 18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313, 18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427, 18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517, 18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637, 18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749, 18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899, 18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009, 19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121, 19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219, 19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319, 19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423, 19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477, 19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571, 19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699, 19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793, 19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891, 19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991, 19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071, 20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149, 20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261, 20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357, 20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443, 20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551, 20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693, 20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771, 20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897, 20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983, 21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067, 21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169, 21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277, 21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383, 21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491, 21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563, 21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647, 21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751, 21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943, 21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039, 22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123, 22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229, 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307, 22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441, 22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543, 22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643, 22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727, 22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817, 22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943, 22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029, 23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099, 23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203, 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321, 23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447, 23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561, 23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629, 23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743, 23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827, 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909, 23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007, 24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091, 24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169, 24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281, 24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413, 24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517, 24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659, 24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767, 24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877, 24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977, 24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097, 25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, 25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303, 25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391, 25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471, 25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603, 25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693, 25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799, 25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913, 25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999, 26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111, 26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203, 26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297, 26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399, 26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, 26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633, 26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711, 26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801, 26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891, 26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987, 26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077, 27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211, 27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329, 27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, 27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551, 27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691, 27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767, 27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827, 27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947, 27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051, 28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151, 28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283, 28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403, 28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499, 28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579, 28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649, 28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729, 28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837, 28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933, 28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059, 29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167, 29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251, 29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, 29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443, 29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573, 29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671, 29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819, 29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921, 29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059, 30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137, 30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241, 30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341, 30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469, 30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559, 30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689, 30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803, 30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871, 30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983, 31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091, 31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183, 31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259, 31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357, 31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511, 31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601, 31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721, 31723, 31727, 31729, 31741, 31751, 31769, 31771, 31793, 31799, 31817, 31847, 31849, 31859, 31873, 31883, 31891, 31907, 31957, 31963, 31973, 31981, 31991, 32003, 32009, 32027, 32029, 32051, 32057, 32059, 32063, 32069, 32077, 32083, 32089, 32099, 32117, 32119, 32141, 32143, 32159, 32173, 32183, 32189, 32191, 32203, 32213, 32233, 32237, 32251, 32257, 32261, 32297, 32299, 32303, 32309, 32321, 32323, 32327, 32341, 32353, 32359, 32363, 32369, 32371, 32377, 32381, 32401, 32411, 32413, 32423, 32429, 32441, 32443, 32467, 32479, 32491, 32497, 32503, 32507, 32531, 32533, 32537, 32561, 32563, 32569, 32573, 32579, 32587, 32603, 32609, 32611, 32621, 32633, 32647, 32653, 32687, 32693, 32707, 32713, 32717, 32719, 32749, 32771, 32779, 32783, 32789, 32797, 32801, 32803, 32831, 32833, 32839, 32843, 32869, 32887, 32909, 32911, 32917, 32933, 32939, 32941, 32957, 32969, 32971, 32983, 32987, 32993, 32999, 33013, 33023, 33029, 33037, 33049, 33053, 33071, 33073, 33083, 33091, 33107, 33113, 33119, 33149, 33151, 33161, 33179, 33181, 33191, 33199, 33203, 33211, 33223, 33247, 33287, 33289, 33301, 33311, 33317, 33329, 33331, 33343, 33347, 33349, 33353, 33359, 33377, 33391, 33403, 33409, 33413, 33427, 33457, 33461, 33469, 33479, 33487, 33493, 33503, 33521, 33529, 33533, 33547, 33563, 33569, 33577, 33581, 33587, 33589, 33599, 33601, 33613, 33617, 33619, 33623, 33629, 33637, 33641, 33647, 33679, 33703, 33713, 33721, 33739, 33749, 33751, 33757, 33767, 33769, 33773, 33791, 33797, 33809, 33811, 33827, 33829, 33851, 33857, 33863, 33871, 33889, 33893, 33911, 33923, 33931, 33937, 33941, 33961, 33967, 33997, 34019, 34031, 34033, 34039, 34057, 34061, 34123, 34127, 34129, 34141, 34147, 34157, 34159, 34171, 34183, 34211, 34213, 34217, 34231, 34253, 34259, 34261, 34267, 34273, 34283, 34297, 34301, 34303, 34313, 34319, 34327, 34337, 34351, 34361, 34367, 34369, 34381, 34403, 34421, 34429, 34439, 34457, 34469, 34471, 34483, 34487, 34499, 34501, 34511, 34513, 34519, 34537, 34543, 34549, 34583, 34589, 34591, 34603, 34607, 34613, 34631, 34649, 34651, 34667, 34673, 34679, 34687, 34693, 34703, 34721, 34729, 34739, 34747, 34757, 34759, 34763, 34781, 34807, 34819, 34841, 34843, 34847, 34849, 34871, 34877, 34883, 34897, 34913, 34919, 34939, 34949, 34961, 34963, 34981, 35023, 35027, 35051, 35053, 35059, 35069, 35081, 35083, 35089, 35099, 35107, 35111, 35117, 35129, 35141, 35149, 35153, 35159, 35171, 35201, 35221, 35227, 35251, 35257, 35267, 35279, 35281, 35291, 35311, 35317, 35323, 35327, 35339, 35353, 35363, 35381, 35393, 35401, 35407, 35419, 35423, 35437, 35447, 35449, 35461, 35491, 35507, 35509, 35521, 35527, 35531, 35533, 35537, 35543, 35569, 35573, 35591, 35593, 35597, 35603, 35617, 35671, 35677, 35729, 35731, 35747, 35753, 35759, 35771, 35797, 35801, 35803, 35809, 35831, 35837, 35839, 35851, 35863, 35869, 35879, 35897, 35899, 35911, 35923, 35933, 35951, 35963, 35969, 35977, 35983, 35993, 35999, 36007, 36011, 36013, 36017, 36037, 36061, 36067, 36073, 36083, 36097, 36107, 36109, 36131, 36137, 36151, 36161, 36187, 36191, 36209, 36217, 36229, 36241, 36251, 36263, 36269, 36277, 36293, 36299, 36307, 36313, 36319, 36341, 36343, 36353, 36373, 36383, 36389, 36433, 36451, 36457, 36467, 36469, 36473, 36479, 36493, 36497, 36523, 36527, 36529, 36541, 36551, 36559, 36563, 36571, 36583, 36587, 36599, 36607, 36629, 36637, 36643, 36653, 36671, 36677, 36683, 36691, 36697, 36709, 36713, 36721, 36739, 36749, 36761, 36767, 36779, 36781, 36787, 36791, 36793, 36809, 36821, 36833, 36847, 36857, 36871, 36877, 36887, 36899, 36901, 36913, 36919, 36923, 36929, 36931, 36943, 36947, 36973, 36979, 36997, 37003, 37013, 37019, 37021, 37039, 37049, 37057, 37061, 37087, 37097, 37117, 37123, 37139, 37159, 37171, 37181, 37189, 37199, 37201, 37217, 37223, 37243, 37253, 37273, 37277, 37307, 37309, 37313, 37321, 37337, 37339, 37357, 37361, 37363, 37369, 37379, 37397, 37409, 37423, 37441, 37447, 37463, 37483, 37489, 37493, 37501, 37507, 37511, 37517, 37529, 37537, 37547, 37549, 37561, 37567, 37571, 37573, 37579, 37589, 37591, 37607, 37619, 37633, 37643, 37649, 37657, 37663, 37691, 37693, 37699, 37717, 37747, 37781, 37783, 37799, 37811, 37813, 37831, 37847, 37853, 37861, 37871, 37879, 37889, 37897, 37907, 37951, 37957, 37963, 37967, 37987, 37991, 37993, 37997, 38011, 38039, 38047, 38053, 38069, 38083, 38113, 38119, 38149, 38153, 38167, 38177, 38183, 38189, 38197, 38201, 38219, 38231, 38237, 38239, 38261, 38273, 38281, 38287, 38299, 38303, 38317, 38321, 38327, 38329, 38333, 38351, 38371, 38377, 38393, 38431, 38447, 38449, 38453, 38459, 38461, 38501, 38543, 38557, 38561, 38567, 38569, 38593, 38603, 38609, 38611, 38629, 38639, 38651, 38653, 38669, 38671, 38677, 38693, 38699, 38707, 38711, 38713, 38723, 38729, 38737, 38747, 38749, 38767, 38783, 38791, 38803, 38821, 38833, 38839, 38851, 38861, 38867, 38873, 38891, 38903, 38917, 38921, 38923, 38933, 38953, 38959, 38971, 38977, 38993, 39019, 39023, 39041, 39043, 39047, 39079, 39089, 39097, 39103, 39107, 39113, 39119, 39133, 39139, 39157, 39161, 39163, 39181, 39191, 39199, 39209, 39217, 39227, 39229, 39233, 39239, 39241, 39251, 39293, 39301, 39313, 39317, 39323, 39341, 39343, 39359, 39367, 39371, 39373, 39383, 39397, 39409, 39419, 39439, 39443, 39451, 39461, 39499, 39503, 39509, 39511, 39521, 39541, 39551, 39563, 39569, 39581, 39607, 39619, 39623, 39631, 39659, 39667, 39671, 39679, 39703, 39709, 39719, 39727, 39733, 39749, 39761, 39769, 39779, 39791, 39799, 39821, 39827, 39829, 39839, 39841, 39847, 39857, 39863, 39869, 39877, 39883, 39887, 39901, 39929, 39937, 39953, 39971, 39979, 39983, 39989]
s = []
n = int(input().rstrip('\r\n'))
t = n
for i in primes:
	while t != 0:
		t -= i
		s.append(i)
		if t == 1:
			t += i
			s.remove(i)
			break
print(len(s))
for i in s:
	print(i, '', end='')


n = int(input())
A = []
if n % 2 != 0:
	n -= 3
	A.append(3)
	for x in range(n // 2):
		A.append(2)
else:
	for x in range(n // 2):
		A.append(2)
print(len(A))
for x in A:
	print(x, end=' ')


n = int(input())
l = []
while n > 0:
	if n - 3 == 0:
		l.append(3)
		n = n - 3
	else:
		l.append(2)
		n = n - 2
print(len(l))
for x in l:
	print(x, end=' ')


a = int(input())
q = a // 2
print(q)
if a % 2 == 0:
	for i in range(q):
		print(str(2) + ' ', end='')
else:
	for i in range(q - 1):
		print(str(2) + ' ', end='')
	print(3)


def solver(N):
	if N & 1 == 0:
		print(N // 2)
		l = [2 for i in range(N // 2)]
		return ' '.join([str(ele) for ele in l])
	else:
		print(N // 2)
		l = [2 for i in range(N // 2 - 1)]
		return ' '.join([str(ele) for ele in l]) + ' 3'
N = int(input())
print(solver(N))


n = int(input())
if n % 2:
	n -= 3
	r = [2 for _ in range(n // 2)]
	r.append(3)
	print(len(r))
	print(' '.join(map(str, r)))
else:
	r = [2 for _ in range(n // 2)]
	print(len(r))
	print(' '.join(map(str, r)))


def main():
	n = int(input())
	print(n // 2)
	if n % 2 == 0:
		for _ in range(n // 2 - 1):
			print(2, end=' ')
		print(2)
	else:
		for _ in range(n // 2 - 1):
			print(2, end=' ')
		print(3)
main()


n = int(input())
if n % 2 == 0:
	print(n // 2)
	a = [2] * (n // 2)
	print(*a, sep=' ')
else:
	print(n // 2)
	a = [2] * (n // 2 - 1)
	a += [3]
	print(*a, sep=' ')


N = int(input())
if N % 2 == 0:
	print(N // 2)
	print(('2 ' * (N // 2)).strip())
if N % 2 == 1:
	print((N - 3) // 2 + 1)
	print('2 ' * ((N - 3) // 2) + '3')


x = int(input())
print(x // 2)
for k in range(x // 2 - x % 2):
	print(2, end=' ')
if x % 2:
	print(3)


number = int(input())
print(number // 2)
x = []
if number % 2 == 0:
	for i in range(number // 2):
		x.append('2')
else:
	for i in range(number // 2 - 1):
		x.append('2')
	x.append('3')
print(' '.join(x))


n = int(input())
ans = []
if n % 2 == 0:
	while n != 0:
		ans.append(2)
		n -= 2
else:
	while n != 3:
		ans.append(2)
		n -= 2
	ans.append(3)
print(len(ans))
print(*ans, sep=' ', end='\n')


n = int(input())
cnt = 0
nums = ''
if n % 2 == 0:
	for i in range(int(n / 2)):
		nums = nums + '2 '
	print(int(n / 2))
	print(nums)
else:
	nums = '3 '
	for i in range(int((n - 3) / 2)):
		nums = nums + '2 '
	print(int((n - 3) / 2 + 1))
	print(nums)


n = int(input())
arr = [2 for i in range(1, n // 2 + 1)]
print(len(arr))
if n % 2 != 0:
	arr[-1] = 3
print(*arr)


n = int(input())
arr = [2] * (n // 2) if n % 2 == 0 else [2] * (n // 2 - 1) + [3]
print(len(arr))
print(*arr)


n = int(input())
k = 0
p = 2
items = []
while n:
	remain = n - p
	if remain != 1:
		items.append(p)
		k += 1
		n = remain
	else:
		p += 1
print(k)
print(' '.join(map(str, items)))


n = int(input(''))
k = 0
p = ''
if n % 2 == 0:
	k = int(n / 2)
	p += '2' * k
else:
	n = n - 3
	k = int(n / 2) + 1
	p = '2' * (k - 1) + '3'
print(k)
print(' '.join(p))


n = int(input())
c = 0
L = []
if n % 2 == 1:
	n = n - 3
	c = c + 1
	L.append(3)
c = c + n // 2
for i in range(n // 2):
	L.append(2)
print(c)
for i in L:
	print(i, end=' ')


def conversion(n):
	d = []
	for s in n:
		s = str(s)
		d.append(s)
	res = ' '.join(d)
	return res
n = int(input())
k = n % 2
n = n - k
l = []
i = 0
while n != 0:
	n = n - 2
	l.append(2)
	i += 1
l.pop()
l.append(2 + k)
print(i)
print(conversion(l))


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	l = [2] * int(n / 2)
	l = [str(x) for x in l]
	print(' '.join(l))
else:
	print(int((n - 1) / 2))
	l = [2] * int((n - 2) / 2)
	l.append(3)
	l = [str(x) for x in l]
	print(' '.join(l))


n = int(input())
(c, l) = (0, [])
if n % 2 == 0:
	c = n // 2
	for _ in range(c):
		l.append('2')
else:
	c = (n - 3) // 2
	for _ in range(c):
		l.append('2')
	l.append('3')
	c += 1
print(c)
print(' '.join(l))


n = int(input())
res = list()
while n >= 2:
	res.append(2)
	n -= 2
if n == 1:
	res[0] += 1
print(len(res))
print(' '.join(map(str, res)))


import sys
input = sys.stdin.readline

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

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

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

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

def foo():
	n = inp()
	print(n // 2)
	if n % 2 == 0:
		for i in range(n // 2):
			print(2, end=' ')
	else:
		for i in range(n // 2 - 1):
			print(2, end=' ')
		print(3)
foo()


a = int(input())
if a % 2 == 0:
	r = 0
	print(a // 2)
	while r < a // 2:
		print(2, end=' ')
		r = r + 1
else:
	r = 0
	print(a // 2)
	while r < a // 2 - 1:
		print(2, end=' ')
		r = r + 1
	print(3)


N = int(input())
if N % 2 == 0:
	a = N // 2
	print(a)
	print('2 ' * a)
else:
	n = abs(N - 3)
	a = n // 2
	print(a + 1)
	print('2 ' * a + '3')


n = int(input())

def IsPrime(x):
	d = 2
	while x % d != 0:
		d += 1
	return d == x
summa = 0
l = list([])
while n > 0:
	if n % 2 == 0:
		summa += 1
		l.append(2)
		n = n - 2
	else:
		summa += 1
		l.append(3)
		n -= 3
print(summa)
print(' '.join((str(v) for v in l)))


num = int(input())
rem = num % 2
quo = num // 2
print(quo)
if rem == 0:
	for i in range(quo):
		print('2', end=' ')
else:
	for i in range(quo - 1):
		print('2', end=' ')
	print('3', end='')


n = int(input())
f = n // 2
if f * 2 == n:
	print(f)
	l = [2] * f
	print(*l)
else:
	print(f)
	l = [2] * f
	l[-1] = 3
	print(*l)


a = int(input())
i = 1
lst = []
v = ' '
if a % 2 == 0:
	k = a // 2
	print(k)
	while i <= k:
		lst.append('2')
		i = i + 1
	for u in lst:
		print(u, end=' ')
else:
	t = a // 2
	k = t - 1
	print(k + 1)
	while i <= k:
		lst.append('2')
		i = i + 1
	for u in lst:
		r = str(u)
		v = v + ' ' + r
	print(v[2:] + ' ' + '3')


n = int(input())
array = []
i = 0
while n > 1:
	if n != 3:
		n -= 2
		i += 1
		array += [2]
	elif n == 3:
		n -= 3
		i += 1
		array += [3]
print(i)
for i in array:
	print(i, end=' ')


n = int(input())
p = ['2' for i in range(n // 2 - 1)] + ['23'[n % 2]]
print(n // 2)
print(' '.join(p))


number = int(input())
if number % 2 == 0:
	print(int(number / 2))
	print(' '.join(['2'] * int(number / 2)))
else:
	print(int((number - 1) / 2))
	print(' '.join(['2'] * int((number - 3) / 2)), 3)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
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 fractions import Fraction
mod = 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)]
n = int(data())
out(n // 2)
if n & 1:
	out(*[2 for i in range(n // 2 - 1)] + [3])
	exit()
out(*[2 for i in range(n // 2)])


x = int(input())
print(x // 2)
print('2 ' * (x // 2 - 1), end='')
print('{}'.format(x % 2 + 2))


peremennaia = int(input())
print(int(peremennaia / 2))
if peremennaia % 2 == 0:
	print(('2 ' * int(peremennaia / 2))[:-1])
else:
	print('2 ' * int(peremennaia / 2 - 1) + '3')


n = int(input())
out = ''
out += '{}\n'.format(n // 2)
if n % 2 == 0:
	for i in range(n // 2):
		out += '2 '
else:
	out += '3 '
	for i in range((n - 3) // 2):
		out += '2 '
print(out.strip())


x = int(input())
three = 0
if x % 2 == 0:
	two = x // 2
else:
	x = x - 3
	two = x // 2
	three = 1
print(two + three)
li = [2] * two + [3] * three
for i in li:
	print(i, end=' ')


p = int(input())
print(p // 2)
if p % 2 == 0:
	s = '2' * (p // 2)
	print(' '.join(s))
elif p % 2 != 0:
	s = '2' * (p // 2 - 1) + '3'
	print(' '.join(s))


import sys
import math
input = sys.stdin.readline
n = int(input())
ans = 0
if n % 2:
	ans += 1
	n -= 3
	ans += n // 2
	print(ans)
	print('3', '2 ' * (n // 2))
else:
	ans += n // 2
	print(ans)
	print('2 ' * (n // 2))


n = int(input())
easylist = []
if not n % 2:
	for i in range(n // 2):
		easylist.append(2)
else:
	for i in range(n // 2 - 1):
		easylist.append(2)
	easylist.append(3)
print(len(easylist))
print(' '.join(list(map(str, easylist))))


n = int(input())
a = []
count = 0
if n % 2 == 1:
	n = n - 3
	a.append(3)
	count += 1
count = count + n // 2
for i in range(n // 2):
	a.append(2)
print(count)
for i in a:
	print(i, end=' ')


def Print(number):
	num = number
	print(num // 2)
	if num % 2 == 0:
		for i in range(num // 2):
			print(2, end=' ')
	else:
		for i in range(num // 2 - 1):
			print(2, end=' ')
		print(3)
n = int(input())
Print(n)


n = int(input())
r = [2] * (n // 2)
if n % 2 != 0:
	r[n // 2 - 1] = 3
print(str(n // 2) + '\n' + ' '.join((str(i) for i in r)))


n = int(input())
if n == 1:
	print(1)
	print(1)
elif n == 3:
	print(1)
	print(3)
elif n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
else:
	print(n // 2)
	print('2 ' * (n // 2 - 1), end='')
	print('3')


import math
n = int(input())
a = []
while n > 3:
	n = n - 2
	a.append(2)
a.append(n)
print(len(a))
for i in range(len(a)):
	print(a[i], end=' ')


num = int(input())
if num % 2 == 0:
	twos = num // 2
	threes = 0
else:
	twos = num // 2 - 1
	threes = 1
output = []
for _ in range(twos):
	output.append('2')
for _ in range(threes):
	output.append('3')
print(twos + threes)
print(' '.join(output))


def checkPrime(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	return True

def printSum(n):
	totalTimes = 0
	l = []
	i = 2
	while n > 0:
		if checkPrime(i):
			if n % i > i or n % i == 0:
				times = n // i
			else:
				times = n // i - 1
			totalTimes += times
			n = n - i * times
			for _ in range(times):
				l.append(i)
		i = i + 1
	return (totalTimes, l)
n = int(input())
(numbers, l) = printSum(n)
print(numbers)
for item in l:
	print(item, end=' ')


n = int(input())
if n == 3:
	print(1)
	print(3)
elif n == 2:
	print(1)
	print(2)
elif n % 2 == 0:
	k = int(n / 2)
	print(k)
	p = '2'
	for i in range(k - 1):
		p += ' 2'
	print(p)
else:
	n = n - 3
	k = int(n / 2)
	print(k + 1)
	p = '2'
	for i in range(k - 1):
		p += ' 2'
	p += ' 3'
	print(p)


n = int(input())
x = []
while n > 3:
	n -= 2
	x.append('2')
if n == 2:
	x.append('2')
else:
	x.append('3')
print(len(x))
print(' '.join(x))


a = int(input())
x = []
if a % 2 == 0:
	c = a // 2
	for i in range(c):
		x.append('2')
	print(str(c))
	print(' '.join(x))
if a % 2 != 0:
	a = a - 3
	c = a // 2
	for i in range(c):
		x.append('2')
	h = '3'
	print(str(c + 1))
	print(' '.join(x), h)


n = int(input())
l = []
cnt = 0
print(n // 2)
while n > 3:
	l.append(2)
	n -= 2
l.append(n)
print(*l, sep=' ')


n = int(input())
ans = []
while n > 0:
	if n == 3:
		ans.append(3)
		n = 0
	if n == 2:
		ans.append(2)
		n = 0
	if n > 3:
		n -= 2
		ans.append(2)
print(len(ans))
for x in ans:
	print(x, end=' ')


n = int(input())
list = []
for i in range(n // 2):
	list.append(2)
if n % 2 != 0:
	list.pop()
	list.append(3)
print(len(list))
print(' '.join((str(x) for x in list)))


n = int(input())

def fe(n):
	if n % 2 == 0:
		print(n // 2)
		for i in range(n // 2):
			print('2', end=' ')
	if n % 2 == 1:
		print(n // 2)
		print('3', end=' ')
		for i in range(n // 2 - 1):
			print('2', end=' ')
fe(n)


n = int(input())
res = n // 2
arr = [2] * res
if n % 2 == 1:
	arr[-1] = 3
print(res)
print(' '.join((str(num) for num in arr)))


n = int(input())
if n % 2 == 0:
	print(n // 2, ' '.join(['2'] * (n // 2)), sep='\n')
else:
	print(n // 2, ' '.join(['2'] * (n // 2 - 1) + ['3']), sep='\n')


n = int(input())
print(n // 2)
for i in range(n // 2 - n % 2):
	print('2', end=' ')
for i in range(n % 2):
	print('3')


def func(n):
	l = []
	while n > 0:
		if n == 3:
			n = 0
			l.append(3)
		else:
			n -= 2
			l.append(2)
	print(len(l))
	print(*l)
n = int(input())
func(n)


num = int(input(''))
ans = []
for i in range(num):
	if num - 2 == 0 or num - 2 >= 2:
		ans.append(2)
		num -= 2
	elif num - 3 == 0 or num - 3 >= 2:
		ans.append(3)
		num -= 3
	elif num - 5 == 0 or num - 5 >= 5:
		ans.append(5)
		num -= 5
print(len(ans))
for i in ans:
	print(i, end=' ')


n = int(input())
times = n // 2
print(times, end='\n')
if n % 2 == 0:
	print(*[2 for i in range(times)])
else:
	two_count = times - n % 2
	res = [2 for i in range(two_count)]
	three_count = n % 2
	for i in range(three_count):
		res.append(3)
	print(*res)


n = int(input())
ans = 0
ansarr = []
if n % 2 == 1:
	ans += 1
	n -= 3
	ansarr.append(3)
s = n // 2
ans += s
for i in range(s):
	ansarr.append(2)
print(ans)
print(*ansarr)


class pt:

	def __init__(self, x, y):
		self.x = x
		self.y = y

def add(B, A):
	return pt(B.x + A.x, B.y + A.y)

def sub(B, A):
	return pt(B.x - A.x, B.y - A.y)

def scal(B, A):
	return B.x * A.x + B.y * A.y == 0

def eq(A, B):
	return A.x == B.x and A.y == B.y

def tr(a, b, c):
	if eq(a, c) or eq(a, b) or eq(c, b):
		return 0
	if scal(sub(a, b), sub(a, c)):
		return 1
	if scal(sub(b, a), sub(b, c)):
		return 1
	if scal(sub(c, b), sub(c, a)):
		return 1
	return 0

def check_almost(a, b, c):
	if tr(a.add(pt(0, 1)), b, c):
		return 1
	if tr(a.add(pt(0, -1)), b, c):
		return 1
	if tr(a.add(pt(1, 0)), b, c):
		return 1
	if tr(a.add(pt(-1, 0)), b, c):
		return 1
	return 0
n = int(input())
if n % 2 == 0:
	print(n // 2)
	for i in range(n // 2):
		print('2', end=' ')
else:
	print(n // 2)
	for i in range(n // 2 - 1):
		print('2', end=' ')
	print('3')


import os
import sys
from io import BytesIO, IOBase
import math

def main():
	n = int(input())
	if n % 2 == 0:
		ans = [2 for x in range(n // 2)]
		print(len(ans))
		print(*ans)
	else:
		n = n - 3
		ans = [2 for x in range(n // 2)]
		ans.append(3)
		print(len(ans))
		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 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()


x = int(input())
Sn = ''
i = 0
while x > 0:
	if x % 2 == 0:
		x = x - 2
		Sn = Sn + ' ' + '2'
		i = i + 1
	elif x % 3 == 0:
		x = x - 3
		Sn = Sn + ' ' + '3'
		i = i + 1
	else:
		x = x - 2
		Sn = Sn + ' ' + '2'
		i = i + 1
print(i)
print(Sn[1:])


n = int(input())
a = [2] * (n // 2)
if n % 2 == 1:
	a.pop(len(a) - 1)
	a.append(3)
print(len(a))
print(*a)


num = int(input())
s = num // 2
l = [2] * s
if num % 2 == 1:
	l[-1] = 3
print(s)
print(*l)


n = int(input())
z = n // 2 * [2]
if n % 2:
	z[-1] = 3
print(len(z), *z)


p = int(input())
if p == 3:
	print(1)
	print(3)
elif p % 2 == 0:
	print(int(p / 2))
	print('2 ' * int(p / 2))
else:
	print(int(p / 2))
	print('2 ' * (int(p / 2) - 1), end='')
	print(3)


n = int(input())
count_3 = 0
if n % 2 == 1:
	count_3 = 1
count_2 = n // 2 - count_3
print(count_3 + count_2)
if count_3 == 1:
	print('3', end=' ')
i = 0
while i < count_2:
	print('2', end=' ')
	i += 1


n = int(input())
a = []
if n % 2 == 0:
	k = n // 2
	for i in range(k):
		a.append('2')
else:
	k = (n - 3) // 2 + 1
	for i in range(k - 1):
		a.append('2')
	a.append('3')
seperator = ' '
print(k)
print(seperator.join(a))


a = int(input())
if a % 2 == 0:
	mass = [2] * (a // 2)
else:
	a -= 3
	mass = [2] * (a // 2) + [3]
print(len(mass))
for i in mass:
	print(i, end=' ')


n = int(input())
if n % 2 == 0:
	ans = n // 2
	array = [2] * ans
else:
	ans = n // 2 - 1
	array = [2] * ans
	array.append(3)
	ans += 1
print(ans)
print(*array)


import math
import itertools
N = int(input())
isprime = [True] * (N + 1)
isprime[0] = isprime[1] = False
sq = math.ceil(N ** 0.5)
for i in range(2, sq + 1):
	if isprime[i]:
		for j in range(i ** 2, N + 1, i):
			isprime[j] = False
primes = list(itertools.compress(range(N + 1), isprime))
if N % 2 == 0:
	for i in primes:
		if N % i == 0:
			a = i
			break
	print(N // a)
	for i in range(N // a):
		print(a, end=' ')
else:
	L = [3]
	N = N - 3
	for i in primes:
		if N % i == 0:
			a = i
			break
	print(N // a + 1)
	for i in range(N // a):
		print(a, end=' ')
	print(3)


import sys
import math
c = int(input())
l = [2] * int(c / 2) if c % 2 == 0 else [2] * int((c - 3) / 2) + [3]
print(len(l))
print(' '.join([str(h) for h in l]))


n = int(input())
count2 = 0
count3 = 0
while n > 0:
	if n == 3:
		count3 += 1
		n -= 3
	else:
		count2 += 1
		n -= 2
print(count3 + count2)
while count2:
	print(2, end=' ')
	count2 -= 1
while count3:
	print(3, end=' ')
	count3 -= 1


x = int(input())
if x % 2 == 0:
	d = x // 2
	print(d)
	for i in range(0, d):
		print('2', end=' ')
else:
	d = x // 2
	print(int(d))
	for j in range(0, d - 1):
		print('2', end=' ')
	print('3')


a = [True]
a *= 100001
ans = []
for i in range(2, 100001, 1):
	if a[i]:
		for j in range(i * i, 100001, i):
			if j < 100001:
				a[j] = False
n = int(input())
i = 2
while n != 0:
	if a[i] and n - i != 1:
		n -= i
		ans += [i]
	else:
		i += 1
print(len(ans))
for i in range(0, len(ans), 1):
	if i != 0:
		print(' ', end='')
	print(ans[i], end='')


n = int(input())
s = ''
c = 0
while n >= 2:
	if n == 3:
		s += ' 3'
		n = 0
		c += 1
	else:
		s += ' 2'
		n -= 2
		c += 1
print(c)
print(s[1:])


n = int(input())
lst = []
print(n // 2)
if n % 2 == 0:
	while n > 0:
		lst.append(2)
		n = n - 2
else:
	while n > 3:
		lst.append(2)
		n = n - 2
	lst.append(3)
s = ''
for i in range(len(lst)):
	s += str(lst[i]) + ' '
print(s)


val = int(input())
lst = list()
if val % 2 == 0:
	while val > 0:
		val -= 2
		lst.append(2)
elif val % 2 != 0:
	while val % 2 != 0:
		val -= 3
		lst.append(3)
	while val > 0:
		val -= 2
		lst.append(2)
print(len(lst))
print(*lst[::-1])


n = int(input())

def output(n):
	if n % 2 == 0:
		print(n // 2)
		for i in range(n // 2):
			print(2, end=' ')
	else:
		I = []
		print((n - 3) // 2 + 1)
		for i in range((n - 3) // 2):
			I.append(2)
		I.append(3)
		for i in I:
			print(i, end=' ')
output(n)


n = int(input())
if n % 2 == 0:
	x = n // 2
	print(x)
	li = [int(2) for i in range(x)]
	print(*li)
else:
	x = n // 2
	print(x)
	li = [int(2) for i in range(x)]
	li[-1] = 3
	print(*li)


n = int(input())
arr = list()
count = 0
while n >= 1:
	n -= 2
	count += 1
	if n == 1:
		arr.append(3)
		break
	else:
		arr.append(2)
print(count)
for x in arr:
	print(x)


def generate(number):
	if number % 2 == 0:
		arr = ['2']
		arr = arr * (number // 2)
	else:
		arr = ['2']
		arr = arr * (number // 2 - 1)
		arr.append('3')
	print(len(arr))
	print(' '.join(arr))
generate(int(input()))


n = int(input())
k = []
if n % 2 == 0:
	for i in range(n // 2):
		k.append(2)
else:
	for i in range((n - 3) // 2):
		k.append(2)
	k.append(3)
print(len(k))
print(*k)


n = int(input())
if n % 2 == 0:
	a = 2
	b = 1
	li = [2]
	while a < n:
		li.append(2)
		a = a + 2
		b = b + 1
	print(b)
	for i in range(0, len(li) - 1):
		print(li[i], end=' ')
	print(li[-1])
if n % 2 == 1:
	a = 3
	b = 1
	li = [3]
	while a < n:
		li.append(2)
		a = a + 2
		b = b + 1
	print(b)
	for i in range(0, len(li) - 1):
		print(li[i], end=' ')
	print(li[-1])


n = int(input())
a = [2] * (n // 2)
if n % 2:
	a[-1] = 3
print(len(a), ' '.join(map(str, a)), sep='\n')


from math import sqrt
n = int(input())
primes = []
check_prime_list = [1] * (n + 1)
check_prime_list[0] = check_prime_list[1] = 0
for i in range(int(sqrt(n) + 1)):
	if check_prime_list[i]:
		for j in range(i * i, n + 1, i):
			check_prime_list[j] = 0
i = 2
while i <= n:
	if check_prime_list[i]:
		while n - i != 1 and n != 0:
			n -= i
			primes.append(i)
	i += 1
print(len(primes))
for i in primes:
	print(i, end=' ')


x = int(input())
z = []
c = 0
while x > 0:
	if x == 3:
		z.append(3)
		x -= 3
	elif x >= 2:
		z.append(2)
		x -= 2
	c += 1
print(c)
print(' '.join((str(_) for _ in z)))


t = int(input())
print(t // 2)
print('2 ' * (t // 2 - 1), 2 + t % 2)


n = int(input())
n1 = n // 2
l = [2] * n1
if n % 2 != 0:
	l.pop()
	l.append(3)
print(n1)
print(*l, sep=' ')


from math import *
n = int(input())
output = []
for i in range(int(floor(n / 2)) - 1):
	output.append(2)
if n % 2 != 0:
	output.append(3)
else:
	output.append(2)
print(len(output))
print(' '.join((str(x) for x in output)))


n = int(input())
if n & 1:
	arr = [2] * ((n - 3) // 2) + [3]
else:
	arr = [2] * (n // 2)
print(len(arr))
print(' '.join(map(str, arr)))


a = int(input())
if a > 1 and a % 2 == 0:
	temp = int(a / 2)
	print(temp)
	for i in range(temp):
		print(2, end=' ')
elif a > 1 and a % 2 != 0:
	temp = int(a / 2 - 1)
	print(temp + 1)
	for i in range(temp):
		print(2, end=' ')
	print(3)


n = int(input())
res = []
if n == 2:
	print(1)
	print(2)
elif n == 3:
	print(1)
	print(3)
else:
	if n % 2 == 0:
		res = [str(e) for e in [2] * (n // 2)]
	else:
		res = [str(e) for e in [2] * (n // 2 - 1) + [3]]
	print(len(res))
	print(' '.join(res))


n = int(input())
mas = []
while n > 3:
	mas.append('2')
	n -= 2
if n == 3:
	mas.append('3')
elif n == 2:
	mas.append('2')
print(len(mas))
print(' '.join(mas))


n = int(input())
rs2 = 0
rs3 = n % 2
if n % 2 == 0:
	rs2 = n // 2
else:
	rs2 = (n - 3) // 2
lst = []
print(rs2 + rs3)
for i in range(rs2):
	lst.append('2')
for i in range(rs3):
	lst.append('3')
print(' '.join(lst))


n = int(input())
result = []
if n % 2 == 1:
	result.append('3')
	n -= 3
result += ['2' for _ in range(n // 2)]
print(len(result))
print(' '.join(result))


n = int(input())
(a, e) = (0, 0)
a = n // 2
b = n - a * 2
if b == 1:
	a -= 1
	d = n - a * 2
	e = d // 3
print(a + e)
print('2 ' * a, '3 ' * e)


n = int(input())
print(n // 2)
x = '2 ' * (n // 2)
if n % 2 == 0:
	print(x.strip())
else:
	print(x[:-3], 3)


n = int(input())
ans1 = n // 2
nof2 = 0
print(ans1)
rem = n % 2
if rem != 0:
	nof2 = ans1 - 1
	for i in range(nof2):
		print('2', end=' ')
	print('3')
elif rem == 0:
	nof2 = ans1
	for i in range(nof2):
		print('2', end=' ')


x = int(input())
c = []
for i in range(0, x // 2):
	c.append(2)
a = x // 2
if x % 2 != 0:
	c[len(c) - 1] = 3
else:
	pass
print(a)
print(*c)


s = int(input())
cnt = 0
n = s % 2
l = s // 2
if n == 0:
	print(l)
	for i in range(l):
		print(2, end=' ')
else:
	l = s - 1
	if l != 4:
		l //= 2
		print(l)
		for i in range(l - 1):
			print(2, end=' ')
		print(3)
	else:
		print(l // 2)
		print(2, 3)


x = int(input())
print(int(x / 2))
for i in range(int(x / 2) - 1):
	print(2, end=' ')
print([2, 3][x % 2])


n = int(input())
c = 0
d = []
if n % 2 == 0:
	c = n // 2
	for i in range(c):
		d.append(str(2))
	print(c)
	print(' '.join(d))
else:
	c += 1
	c += (n - 3) // 2
	d.append(str(3))
	for i in range(c - 1):
		d.append(str(2))
	print(c)
	print(' '.join(d))


n = int(input())
print(n // 2)
s = ''
while n > 3:
	s += '2' + ' '
	n -= 2
print(s + str(n))


x = int(input())
ba = 0
if x % 2:
	ba = 1
hai = (x - ba * 3) // 2
print(hai + ba)
for i in range(hai):
	print(2, end=' ')
if ba:
	print(3)


n = int(input())
if n % 2 == 0:
	m = n // 2
	o = ('2 ' * m).rstrip()
else:
	m = n // 2
	o = '2 ' * (m - 1) + '3'
print(m)
print(o)


n = int(input())
i = 1
while 2 * i < n:
	i = i + 1
if 2 * i == n:
	print(i)
	print('2 ' * i)
else:
	print(i - 1)
	print('2 ' * (i - 2) + '3')


n = int(input())
k = int(n // 2)
print(k)
if n % 2 == 0:
	print('2 ' * k)
elif k == 1:
	print(3)
else:
	print('2 ' * (k - 1), 3)


import sys
input = sys.stdin.readline
n = int(input())
if n % 2 == 0:
	ans1 = n // 2
	ans2 = [2] * ans1
else:
	ans1 = n // 2
	ans2 = [2] * (ans1 - 1)
	ans2.append(3)
print(ans1)
print(*ans2)


N = int(input())
if N % 2 == 0:
	times = N / 2
else:
	times = (N - 3) / 2
result = list()
for _ in range(0, int(times)):
	result.append(2)
if N % 2 != 0:
	result.append(3)
print(len(result))
print(*result, sep=' ')


import sys
n = int(input())
count = 0
result = ''
if n % 2 == 1:
	count += 1
	result += '3 '
	n -= 3
if n % 2 == 0:
	count += n // 2
	for i in range(n // 2):
		result += '2 '
print(count)
print(result)


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()]
number = read_int()
digits = number // 2
print(digits)
Answer = ['2'] * (digits - 1)
Answer.append(['2', '3'][number - digits * 2])
print(*Answer)


n = int(input())
a = []
a = [2] * (n // 2)
if sum(a) + 1 == n:
	a.pop()
	a.append(3)
k = len(a)
print(k)
for i in a:
	print(i, end=' ')


n = int(input())
if n % 2 == 0:
	print(n // 2)
	for el in range(n // 2):
		print(2, end=' ')
	exit(0)
else:
	n -= 3
	print(n // 2 + 1)
	for el in range(n // 2):
		print(2, end=' ')
	print(3)


n = int(input())
cnt = 0
res = ''
if n % 2:
	n -= 3
	cnt += 1
	res = '3 '
cnt += n // 2
res += n // 2 * '2 '
res = res[:-1]
print(cnt)
print(res)


n = int(input())
if n % 2 == 0:
	ans = n // 2
	print(ans)
	print(' '.join(['2'] * ans))
else:
	ans = 1 + (n - 3) // 2
	print(ans)
	print(' '.join(['2'] * (ans - 1) + ['3']))


n = int(input())
print(n // 2)
if n % 2 == 0:
	primes = list('2' * (n // 2))
else:
	primes = list('2' * (n // 2 - 1) + '3')
print(*primes, sep=' ')


num = int(input())
flag = 0
if num <= 100000 and num >= 2:
	if num % 2 != 0:
		flag = 1
		num -= 3
	print(flag + num // 2)
	result = ''
	print(('3 ' if flag == 1 else '') + '2 ' * (num // 2))


def main():
	n = int(input())
	(m, st) = solve(n)
	print(m)
	print(st)

def solve(n):
	m = 0
	if not n % 2:
		m = n // 2
		st = '2 ' * m
		st = st[:-1]
	else:
		m = (n - 3) // 2 + 1
		st = '2 ' * (m - 1) + '3 '
		st = st[:-1]
	return (m, st)
main()


n = int(input())
print(n // 2)
if n % 2 == 0:
	print((n // 2 * '2 ').rstrip())
else:
	print((n // 2 - 1) * '2 ', '3', sep='')


n = int(input())
s = []
while n - 2 >= 0 and n - 2 != 1:
	n -= 2
	s.append(str(2))
if n > 0:
	s.append(str(3))
print(len(s))
print(' '.join(s))


n = int(input())
t = n // 2
print(t)
a = [2] * t
if n & 1:
	a[-1] = 3
print(*a)


import math

def get_primes(prime_supr):
	is_prime = [0] * 2 + [1] * prime_supr
	for i in range(2, int(math.sqrt(prime_supr)) + 1):
		if is_prime[i]:
			for j in range(i * i, prime_supr + 1, i):
				is_prime[j] = 0
	return is_prime
get_int = lambda : map(int, input().split())
a = int(input())
if a % 2:
	print(a // 2)
	for i in range(a // 2 - 1):
		print(2, end=' ')
	print(3)
else:
	print(a // 2)
	for i in range(a // 2):
		print(2, end=' ')


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


n = int(input())
list1 = []
if n % 2 == 0:
	for i in range(n // 2):
		list1.append(2)
if n % 2 != 0:
	for i in range((n - 3) // 2):
		list1.append(2)
	list1.append(3)
print(len(list1))
print(*list1)


n = int(input())
twos = twos = n // 2
threes = 0
if n % 2 == 1:
	twos -= 1
	threes = 1
print(twos + threes)
l = [2] * twos + [3] * threes
print(' '.join([str(x) for x in l]))


(a, b, l, s) = (0, 0, [], [])
n = int(input())
if n % 2 == 0:
	r = int(n / 2)
	l = [2] * r
else:
	r = int(n / 2)
	l = [2] * (r - 1)
	l.append(3)
print(len(l))
print(*l)


a = int(input())
(r, x) = (0, 2)
t = 0
while r < a:
	r += 2
	t += 1
q = [x] * t
p = [x] * (t - 2) + [3]
if a % 2 == 0:
	print(t)
	print(*q, sep=' ')
else:
	print(t - 1)
	print(*p, sep=' ')


n = int(input())
count = 0
p = []
while n > 0:
	if n - 2 > 1 or n == 2:
		count += 1
		n = n - 2
		p.append(2)
	if n == 3:
		count += 1
		n = n - 3
		p.append(3)
print(count)
for i in p:
	print(i, end=' ')


def main():
	n = int(input())
	k = n // 2 - 1
	s = k * '2 '
	if n % 2 == 1:
		s += '3'
	else:
		s += '2'
	print(k + 1)
	print(s)
main()


n = int(input())
if n <= 3:
	print(1)
	print(n)
else:
	for i in range(2, n):
		if n // i > 1:
			m = i
	print(m)
	s = str()
	if n % m == 0:
		for i in range(m):
			s += str(n // m) + ' '
	else:
		for i in range(m - 1):
			s += str(n // m) + ' '
		s += str(n // m + 1)
	print(s)


n = int(input())
d = []
if n % 2 == 0:
	k = n // 2
	n = k
	for i in range(k):
		d.append(2)
else:
	k = (n - 3) // 2
	n = k + 1
	for i in range(k):
		d.append(2)
	d.append(3)
print(n)
print(*d)


n = int(input())
print(n // 2)
print(' '.join(('2' for x in range(n // 2))) if not n % 2 else ' '.join(('2' for x in range(n // 2 - 1))) + ' 3')


n = int(input())
num_of_3 = 0
if n % 2 == 1:
	num_of_3 = 1
	n -= 3
num_of_2 = n // 2
print(num_of_2 + num_of_3)
if num_of_3 == 1:
	print(3, end=' ')
for _ in range(num_of_2):
	print(2, end=' ')


n = int(input())
t = 0
t = n // 2
print(t)
if n % 2 == 0:
	print('2 ' * t)
if n % 2 != 0:
	print('2 ' * (t - 1) + '3')


a = int(input())
if a % 2 == 0:
	res = int(a / 2)
	res_list = [2] * res
elif a % 2 != 0:
	res = int((a - 3) / 2 + 1)
	res_list = [2] * (res - 1)
	res_list.append(3)
print(res)
print(' '.join(map(str, res_list)))


n = int(input())
ans = []
while n > 1:
	if n > 3 or n == 2:
		n -= 2
		ans.append(2)
	else:
		n -= 3
		ans.append(3)
print(len(ans))
print(' '.join((str(i) for i in ans)))


n = int(input())
print(n // 2)
while n:
	if n == 3:
		print(3, end=' ')
		n -= 3
	elif n >= 2:
		print(2, end=' ')
		n -= 2


n = int(input())
b = list()
if n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2)):
		b.append(2)
if n % 2 != 0:
	n -= 3
	print(int(n / 2) + 1)
	for i in range(int(n / 2)):
		b.append(2)
	b.append(3)
print(*b, sep=' ')


x = int(input())
i = 0
j = 0
if x % 2 == 0:
	y = x / 2
	print(int(y))
	while j < y:
		print(2, end=' ')
		j += 1
else:
	y = x / 2
	print(int(y))
	y -= 2
	while j < y:
		print(2, end=' ')
		j += 1
	print(3)


a = int(input())
c = str('')
k = 0
if a % 2 == 0:
	b = a / 2
	while b > 0:
		c = c + str('2 ')
		b = b - 1
		k = k + 1
	print(k)
	print(c)
else:
	b = a / 2 - 1
	while b > 1:
		c = c + str('2 ')
		b = b - 1
		k = k + 1
	print(k + 1)
	print(c + '3')


n = int(input())
c = n // 2
c -= 1
if n % 2 == 1:
	c -= 1
st = '2' if c >= 0 else ''
for i in range(c):
	st += ' 2'
print(c + 1) if n % 2 == 0 else print(c + 2)
if st == '':
	print(3)
else:
	print(st + ' 3') if n % 2 == 1 else print(st)


n = int(input())
if n % 2:
	c = ['2'] * int((n - 3) / 2)
	c.append('3')
else:
	c = ['2'] * int(n / 2)
print(len(c))
print(' '.join(c))


n = int(input())
arr = []
if n % 2 == 0:
	arr = [2] * (n // 2)
else:
	arr = [2] * (n // 2 - 1)
	arr.append(3)
print(n // 2)
print(' '.join((str(a) for a in arr)))


n = int(input())
k = n // 2
n = n % 2
op = []
for _ in range(k):
	op.append(2)
if n == 1:
	op.pop(-1)
	op.append(3)
print(k)
print(*op)


import math
n = int(input())
s1 = '2 '
s2 = '3 '
if n % 2 == 1:
	p = math.floor(n / 2)
	s = s1 * (p - 1) + s2
elif n % 2 == 0:
	p = math.floor(n / 2)
	s = s1 * p
print(p)
print(s)


inp = int(input())
ans = 0
primeNo = [i for i in range(1000000) if i % 2 != 0]
if inp % 2 == 0:
	print(inp // 2)
	print('2 ' * (inp // 2))
else:
	temp = 3
	print((inp - temp) // 2 + 1)
	for i in range((inp - temp) // 2):
		print('2', end=' ')
	print(temp)


p = int(input())
if p % 2 == 0:
	print(p // 2)
	print('2 ' * (p // 2))
else:
	print((p - 3) // 2 + 1)
	print(3, '2 ' * ((p - 3) // 2))


c = int(input())
print(c // 2)
while c > 3:
	c -= 2
	print(2, end=' ')
print(c)


t = int(input())
print(int(t / 2))
if t % 2 == 1:
	print('3 ', end='')
	t -= 3
while t > 0:
	print('2 ', end='')
	t -= 2


def primes(n):
	primfac = []
	d = 2
	while d * d <= n:
		while n - d > 1:
			primfac.append(d)
			n -= d
		d += 1
	if n > 1:
		primfac.append(n)
	return primfac
n = int(input())
ans = primes(n)
print(len(ans))
print(*ans, sep=' ')


prim = int(input())
y = True
if prim % 2 != 0:
	y = False
x = int(prim / 2)
a = ''
for n in range(x - 1):
	a = a + str('2 ')
if y == False:
	a = a + str('3')
else:
	a = a + str('2')
print(x)
print(a)


n = int(input())
(x, y) = (n // 2, 0)
if n % 2 != 0:
	x -= 1
	y = 1
s = '2 ' * x + '3' * y
print(x + y)
print(s)


x = int(input())
print(x // 2)
n_3 = int(x % 2 == 1)
n_2 = x // 2 - int(x % 2 == 1)
for i in range(n_2):
	print(2, end=' ')
if n_3:
	print(3, end='')


list1 = []
n = int(input())
count = 0
while n != 0:
	if n % 2 == 0:
		count = count + n / 2
		for i in range(0, n // 2):
			list1.append(2)
		break
	else:
		n = n - 3
		count = count + 1
		list1.append(3)
print(int(count))
list1.sort()
for i in list1:
	print(i)


n = int(input())
if n % 2 == 0:
	print(int(n / 2))
	print('2 ' * int(n / 2))
elif n == 3:
	print('1')
	print('3')
elif n == 5:
	print('2')
	print('2 3')
else:
	print(int(n / 2))
	print('2 ' * int(n / 2 - 2), '2 3')


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


n = int(input())
arr = []
while n >= 2:
	if n == 3:
		arr.append(3)
		n = n - 3
	else:
		arr.append(2)
		n = n - 2
print(len(arr))
for values in arr:
	print(values, end=' ')


w = int(input())
q = ''
if w % 2:
	print(w // 2)
	for i in range(w // 2 - 1):
		q += '2 '
	q += '3'
else:
	print(w // 2)
	for i in range(w // 2 - 1):
		q += '2 '
	q += '2'
print(q)


t = int(input())
two = 0
three = 0
if t % 2 is 0:
	two = int(t / 2)
else:
	two = int((t - 3) / 2)
	three = 1
print(str(two + three))
for i in range(two):
	print('2 ', end='')
for i in range(three):
	print('3', end='')


n = int(input())
lst = []
while n > 1 and n != 3:
	lst.append(2)
	n -= 2
if n == 3:
	lst.append(3)
print(len(lst))
for i in lst:
	print(i, end=' ')


def main():
	n = int(input())
	cnt = n // 2
	print(cnt)
	if n % 2:
		print(3, end=' ')
		n -= 3
	print('2 ' * (n // 2))
	return
main()


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p + p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

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

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	n = int(input())
	print(n // 2)
	if n % 2 == 0:
		print(*[2] * (n // 2))
	else:
		print(*[2] * (n // 2 - 1) + [3])
for _ in range(1):
	solve()


def read(t=int):
	return t(input())

def read_arr(t=int):
	return [t(i) for i in str(input()).split()]
t = 1
for i in range(t):
	n = read()
	if n % 2 == 0:
		print(n // 2)
		for i in range(n // 2):
			print(2, end=' ')
	else:
		print(n // 2)
		for i in range((n - 2) // 2):
			print(2, end=' ')
		print(3)


n = int(input())
if n % 2 == 0:
	q = int(n / 2)
	p = [2 for i in range(q)]
	print(q)
	print(*p)
else:
	z = int(n / 2)
	x = [2 for i in range(z - 1)]
	x.append(3)
	print(z)
	print(*x)


number = int(input())
three = False
twos = number // 2
number -= 2 * twos
if number > 0:
	three = True
	twos -= 1
print(twos + three)
result = ''
for item in range(twos):
	result += '2 '
if three:
	result += '3'
print(result)


n = int(input())
cnt = 0
a = []
while n != 0:
	if n % 2 == 1:
		cnt += 1
		a.append(3)
		n -= 3
	else:
		cnt += 1
		a.append(2)
		n -= 2
print(cnt)
for i in a:
	print(i, end=' ')
print()


import math
n = int(input())
ans = []
if n % 2 == 0:
	print(int(n / 2))
	while n > 0:
		ans.append(2)
		n -= 2
elif n % 2 == 1:
	print(int((n - 1) / 2))
	n -= 3
	ans.append(3)
	while n > 0:
		ans.append(2)
		n -= 2
print(' '.join(map(str, ans)))


x = int(input())
r = int(x / 2)
print(r)
for i in range(r - 1):
	print('2', end=' ')
if x % 2 == 0:
	print(2)
if x % 2 == 1:
	print(3)


n = int(input())
print(n // 2)
k = ['2' for i in range(n // 2)]
if n % 2:
	k[-1] = '3'
print(' '.join(k))


n = int(input())
print(n // 2)
if n % 2 == 1:
	print(3, end=' ')
	n -= 3
if n >= 2:
	print(' '.join(['2'] * (n // 2)))