Harryxun/stf_run huggingface dataset:
def pop(x):
    binary = []
    while True:
        if x == 1:
            binary.append(x)
            break
        q,mod = divmod(x,2)
        binary.append(mod)
        x = q
    return sum(binary)

N = int(input())
X = list(map(int,list(input())))

pop_X = sum(X)
X_10 = sum([X[i]*2**(N-i-1) for i in range(N)])

answer = []
for i in range(N):
    count = 0
    Xi_10 = X_10 + 2**(N-i-1) if X[i]==0 else X_10 - 2**(N-i-1)
    pop_Xi = pop_X + 1 if X[i]==0 else pop_X -1
    while True:
        r = Xi_10 % pop_Xi
        count+= 1
        if r == 0:
            break
        Xi_10 = r
        pop_Xi = pop(r)
    answer.append(count)

for i in range(N):
    print(answer[i])
    

### FIXED CODE ###

N = int(input())
X = input()

pop_X = sum(map(int,list(X)))
X_10 = int('0b'+X,2)

r_0 = X_10%(pop_X+1)
diff_0 = 1%(pop_X+1)

zero_flag = False
if pop_X == 1:
    zero_flag = True
else:
    r_1 = X_10%(pop_X-1)
    diff_1 = 1%(pop_X-1)

answer = []


for i in range(N)[::-1]:
    if X[i]=='0':
        r = (r_0+diff_0)%(pop_X+1)
    else:
        if zero_flag:
            answer.append(0)
            diff_0 = (diff_0*2)%(pop_X+1)
            continue
        else:
            r = (r_1-diff_1)%(pop_X-1)
    count = 1
    while True:
        if r == 0:
            break
        pop = sum(map(int,list(bin(r)[2:])))
        r = r % pop
        count += 1
        
    answer.append(count)
    diff_0 = (diff_0*2)%(pop_X+1)
    if zero_flag:
        continue
    diff_1 = (diff_1*2)%(pop_X-1)

for i in answer[::-1]:
    print(i)
a, b, c = map( int, input().split())

print( max( 0, c - ( a - b ) )

### FIXED CODE ###

a, b, c = map( int , input().split())

print( max( 0, c - ( a - b )))
import math
import itertools


N, D = (int(i) for i in input().split())
X = [0]*N


for n in range(N):
    l = input().split()
    X[n]=[0]*D
    for d in range(D):
        X[n][d] = int(l[d])


count = 0
for y, z in itertools.combinations(X, 2):
    print(f"y={y}, z={z}")
    d = math.sqrt(sum(pow(y[i] - z[i], 2) for i in range(D)))
    if d.is_integer():
        count += 1

print(count)


### FIXED CODE ###

import math
import itertools


N, D = (int(i) for i in input().split())
X = [0]*N


for n in range(N):
    l = input().split()
    X[n] = [0]*D
    for d in range(D):
        X[n][d] = int(l[d])


count = 0
for y, z in itertools.combinations(X, 2):
    d = math.sqrt(sum(pow(y[i] - z[i], 2) for i in range(D)))
    if d.is_integer():
        count += 1

print(count)
x,a,b=(input() for _ in range(3))
print((x - a)%b)

### FIXED CODE ###

x,a,b=(int(input()) for _ in range(3))
print((x - a)%b)
a = int(input())
if a < 3200:
  print("red")
else:
  ptint(input())

### FIXED CODE ###

a = int(input())
if a < 3200:
  print("red")
else:
  print(input())
N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    time.sort()
    for i in range(len(time)//2-1):
        if time[2*i+1] == time[2*i+2]:
            remove_list.append(time[i])
    for i in range(len(remove_list)):
        time.remove(remove_list[i])
        time.remove(remove_list[i])
    # print(time)
    # print(f)
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1

ans = -1
for i in range(1,max_end):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

# print(f)
print(ans)


### FIXED CODE ###

N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    time.sort()
    for i in range(1,len(time)-1):
        if time[i] == time[i+1]:
            remove_list.append(time[i])
    time = list(set(time)-set(remove_list))
    time.sort()
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1
ans = -1
for i in range(1,max_end+1):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

print(ans)
a = input()
b = int(input())

if b >= 3200:
  print(a)
else:
  print("red")

### FIXED CODE ###

a = int(input())
b = input()

if a >= 3200:
  print(b)
else:
  print('red')
while 1:
	H,W=map(int,raw_input().split())
	if H==0 and W==0:
		break
	for i in H:
		print "#"*W 
	print "/n"

### FIXED CODE ###

while 1:
	H,W=map(int,raw_input().split())

	if H==0 and W==0:
		break

	for i in range(H):
		print "#"*W 
	print ""
N = 3
A=[[10, 40, 70], [20, 50, 80], [30, 60, 90]]
dp = [[0] * 3 for _ in range(N)]  # 初期化
dp[0] = A[0]  # 初期化
print(dp[0])
for i in range(N-1):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = max(dp[i+1][k], dp[i][j] + A[i][k])
print(max(dp[N-1])            


### FIXED CODE ###

N = int(input())
Y = []
for _ in range(N):
    Y.append(list(map(int, input().split())))  # Y = [[3, 9, 7], [10, 3, 2]]
dp = [[0] * 3 for _ in range(N)]  # 初期化
dp[0] = Y[0]  # 初期化

# A, B, C の3パターン以外にも対応
for i in range(N-1):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][j] = max(dp[i+1][j], dp[i][k] + Y[i+1][j])
print(max(dp[N-1]))
N=int(input("Enter test cases:"))
M=int(input("Enter M:"))
if(N==M):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from sys import stdin
n,m = map(int,stdin.readline().split())
print("Yes" if n==m else "No")
A, B = map(int, input().split())

AB = list(range(A, B+1))

ans = []
while AB[-1] != 0:
    div = lambda x: x // 2
    rem = lambda x: x % 2
    
    AB_bit = list(map(rem, AB))
    AB = list(map(div, AB))
    ans.append(str(sum(AB_bit) % 2))

ans.append('0')
ans.reverse()
ans_10 = int(''.join(ans), 2)
print(ans_10)


### FIXED CODE ###

A, B = map(int, input().split())

def cal_xor(X):
    X = X+1
    xor_sum = 0
    digit = 1
    while digit < X:
        digit *= 2
        bit_count = (X // digit) * (digit // 2)
        bit_count += max(0, (X % digit) - (digit // 2))
        
        if bit_count % 2 == 1:
            xor_sum += digit // 2
    
    return xor_sum
        

ans = cal_xor(A-1) ^ cal_xor(B)
print(ans)
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
if N == 3:
    print('2 5 63')
    exit()
l = np.array([3, 9, 2, 10, 4, 8, 6, 12]).astype('int32')
l2 = np.array([6, 3, 9, 2, 10, 4, 8,12]).astype('int32')
time = N // 12
answer = np.array([])
for i in range(time):
    answer = np.append(answer, l + 12 * i)
remain = N % 12
if remain%2 == 0:
    answer = np.append(answer, l[:remain] + 12 * time)
else:
    answer = np.appen(answer, l2[:remain] + 12 * time)

answer = [int(x) for x in answer]
print(*answer)
# 48


### FIXED CODE ###

import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
if N == 3:
    print('2 5 63')
    exit()
l = np.array([3, 9, 2, 10, 4, 8, 6, 12]).astype('int32')
l2 = np.array([6, 3, 9, 2, 10, 4, 8, 12]).astype('int32')
time = N // 8
answer = np.array([])
for i in range(time):
    answer = np.append(answer, l + 12 * i)
remain = N % 8
if remain%2 == 0:
    answer = np.append(answer, l[:remain] + 12 * time)
else:
    answer = np.append(answer, l2[:remain] + 12 * time)

answer = [int(x) for x in answer]
print(*answer)
# 48
#include <bits/stdc++.h>
using namespace std;

int main() {
  long long A; cin >> A;
  double B; cin >> B;
  double ans = A * B;
  cout << fixed << setprecision(0);
  cout << floor(ans) << endl;
}

### FIXED CODE ###

import math

A, B = input().split()
C = int(B[0:1])
D = int(B[2:])
print(int(A) * C + int(A) * D // 100)
import math
while True:
    s=input().split()
    if s[1]==?:
        break
    elif s[1]==+:
        print(int(s[0])+int(s[2]))
    elif s[1]==-:
        print(int(s[0])-int(s[2]))
    elif s[1]==*:
        print(int(s[0])*int(s[2]))
    elif s[1]==/:
        print(math.floor(int(s[0])/int(s[2])))


### FIXED CODE ###

import math
while True:
    s=input().split()
    if s[1]=="?":
        break
    elif s[1]=="+":
        print(int(s[0])+int(s[2]))
    elif s[1]=="-":
        print(int(s[0])-int(s[2]))
    elif s[1]=="*":
        print(int(s[0])*int(s[2]))
    elif s[1]=="/":
        print(math.floor(int(s[0])/int(s[2])))
x,y,z,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a = sorted(a)
b = sorted(b)
c = sorted(c)
memory = []
ai = x-1
bi = y-1
ci = z-1
p = 10**11
while k>0:
    ps = []
    abc = []
    for dx in range(-6,6):
        for dy in range(-6,6):
            for dz in range(-6,6):
                if not (ai+dx>=0 and ai+dx<x and bi+dy>=0 and bi+dy<y and ci+dz>=0 and ci+dz<z):
                    continue
                tmp = a[ai+dx]+b[bi+dy]+c[ci+dz]
                if p >= tmp and not (ai+dx,bi+dy,ci+dz) in memory:
                    ps.append(tmp) 
                    abc.append((ai+dx, bi+dy, ci+dz))
    p = max(ps)
    i = ps.index(p)
    memory.append(abc[i])
    print(p)
    k -= 1


### FIXED CODE ###

def main():
    X, Y, Z, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)

    T = []
    for a in A:
        for b in B:
            T.append(a + b)

    T = sorted(T, reverse=True)[:min(K, len(T))]

    res = []
    for t in T:
        for c in C:
            res.append(t + c)

    res = sorted(res, reverse=True)[:K]
    for r in res:
        print(r)

if __name__ == "__main__":
    main()
n=int(input())
a=list(map(int,input().split()))

def dp(i,n,a):
	if i==(n-1):
		return 0
	elif i>n-1:
		return 1e9
	d1=1e9
	d2=1e9
	if(i+1<=n-1):
		d1=dp(i+1,n,a)+abs(a[i]-a[i+1])
	if(i+2<=n-1):
		d2=dp(i+2,n,a)+abs(a[i]-a[i+2])
	return min(d1,d2)

print(dp(0,n,a))


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))

dp = [0]*n
for i in range(1,n):
	if i == 1:
		dp[i]=abs(a[0]-a[1])
	else:
		dp[i]=min(dp[i-1]+abs(a[i-1]-a[i]),dp[i-2]+abs(a[i-2]-a[i]))
print(dp[n-1])
N = int(input())
H = [int(i) for i in input().split()]
can_move_nums = [None] * N

for i in range(N):
    cnt = 0
    if i == N-1:
        break
    
    for j in range(i, N-1):
        if H[j+1] <= H[j]:
            cnt += 1
        else:
            break
        
    
    can_move_nums[now] = cnt 

print(max(can_move_nums)) 

### FIXED CODE ###

N = int(input())
H = [int(i) for i in input().split()]
H = H[::-1]
can_move_nums = [0] * N
start = 0

for i in range(1, N):
    if H[i] >= H[i-1]:
        can_move_nums[i] = can_move_nums[i-1]+1        
        
print(max(can_move_nums))
n,a,b=map(int,input().split())
mod=10**9+7
from math import pow
def comb(n,k,mod):
  if k>n-k:
    k=n-k
  c=1
  for i in range(n-k+1,n+1):
    c*=i
  d=1  
  for i in range(1,k+1):
    d*=i
return(c*pow(d,mod-2,mod)%mod)

ans=(2**n-1)-comb(n,a,mod)-comb(n,b,mod)
return (ans%mod)

### FIXED CODE ###

n,a,b=map(int,input().split())
mod=10**9+7
def comb(n,k,mod):
  if k>n-k:
    k=n-k
  c=1
  for i in range(n-k+1,n+1):
    c*=i
    c%=mod
  d=1  
  for i in range(1,k+1):
    d*=i
    d%=mod
  return (c*pow(d,mod-2,mod))%mod

ans=pow(2,n,mod)-1-comb(n,a,mod)-comb(n,b,mod)
print(ans%mod)
print({
  '000': 0,
  '001': 1,
  '010': 1,
  '011': 2,
  '100': 1,
  '101': 2,
  '110': 2,
  '111' 3
}[input()])

### FIXED CODE ###

print((lambda s: int(s[0])+int(s[1])+int(s[2]))(input()))
n,k = map(int, input(), split())

if n%k==0:
  print(0)
  
else:
  print(1)

### FIXED CODE ###

n,k = map(int, input().split())

if n%k==0:
  print(str(0))

else:
  print(str(1))
a,b = map(int,input().split())
c = ((a*(a-1)) / 2 + ((b * (b-1)) / 2 )
print(int(c))

### FIXED CODE ###

N, M = map(int, input().split())
print((N*(N-1))//2 + (M*(M-1))//2)
import math
n=int(input())
l=[int(x) for x in input().split()]
for k in range(n):
  L=l.pop(k)
  ans=0
  for i in range(n+1):
    c=l.count(i)
    if c>1:
      ans=ans+math.factorial(c) // (math.factorial(c- 2) * 2)
  print(ans)
  l.insert(k,L)

### FIXED CODE ###

import math
n,m=map(int,input().split())
if n>1:
  N=math.factorial(n) // (math.factorial(n - 2) * 2)
else:
  N=0
if m>1:
  M=math.factorial(m) // (math.factorial(m - 2) * 2)
else:
  M=0
print(N+M)
a=int(input()).split()
if a[0]<a[1]:
    print("a < b")
elif a[0]>a[1]:
    print("a > b")
else:
    print("a == b")


### FIXED CODE ###

a,b=map(int,input().split())
if a<b:
    print("a < b")
elif a>b:
    print("a > b")
else:
    print("a == b")
sys.stdin=f

S=input()
T=input()

for i in range(len(S)):
    if S[i]==T[i]:
        continue
    else:
        print("No")
        sys.exit()

print("Yes")

### FIXED CODE ###

import sys

S=input()
T=input()

for i in range(len(S)):
    if S[i]==T[i]:
        continue
    else:
        print("No")
        sys.exit()

print("Yes")
import sys
readline = sys.stdin.readline

S = readline().rstrip()
T = readline().rstrip()

if len(set(T) - set(S)) > 0:
  print(-1)
  exit(0)
  
import bisect
# Tの各文字を探す
S2 = S * 2
from collections import defaultdict
# ある文字が何文字目にあるか辞書
dic = defaultdict(list)

for i in range(len(S2)):
  dic[S2[i]] += [i]

ind = -1
ans = 0
for t in T:
  # 探す文字はt
  targets = dic[t]
#  print("targets",targets,"t",t,"ind + 1",ind + 1)
  newind = targets[bisect.bisect_left(targets, ind + 1)]
#  print("t",t,"S2",S2,"newind",newind)
  ans += (newind - ind)
  if newind > len(S):
    newind -= len(S)
  ind = newind

print(ans)

  
  

### FIXED CODE ###

s=input()
t=input()
if len(set(t)-set(s))>0:
  print(-1)
  exit(0)

ss=s*2
ind=-1
turn=0
for c in t:
  nex=ss[ind+1:].find(c)
  ind=(ind+1)+nex
  if ind>=len(s):
    ind-=len(s)
    turn+=1

print(turn*len(s)+ind+1)
def dfs(v,p):
    for i in tree[v]:
        if i==p:
            continue
        res[i]+=res[v]
        dfs(i,v)

n,q = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

res = [0]*n
for i in range(q):
    p,x = map(int,input().split())
    res[p-1] += x

dfs(0,0)
print(*res)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def dfs(v,p):
    for i in tree[v]:
        if i==p:
            continue
        res[i]+=res[v]
        dfs(i,v)

n,q = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

res = [0]*n
for i in range(q):
    p,x = map(int,input().split())
    res[p-1] += x

dfs(0,-1)
print(*res)
l = [input() for _ in [0] * 5]
keta =[]
for i in l:
    keta.append(i)
#print(keta)
xxx = []
for j in keta:
    if int(j[-1]) != 0:
        xxx.append(int(j) + (10 - int(j[-1])))
    else:
        xxx.append(int(j))
#print(xxx)
yyy = []
for k in keta:
    yyy.append(int(k[-1]))
#print(yyy)
zzz = []
for m in yyy:
    if int(m) > 0:
        zzz.append(m)
#print(zzz)
p = min(zzz)
print(sum(xxx) - (10 - p))


### FIXED CODE ###

l = [input() for _ in [0] * 5]
keta =[]
for i in l:
    keta.append(i)
#print(keta)
xxx = []
for j in keta:
    if int(j[-1]) != 0:
        xxx.append(int(j) + (10 - int(j[-1])))
    else:
        xxx.append(int(j))
#print(xxx)
yyy = []
for k in keta:
    yyy.append(int(k[-1]))
#print(yyy)
zzz = []
for m in yyy:
    if int(m) > 0:
        zzz.append(m)
#print(zzz)
if 0 < sum(zzz):
    p = min(zzz)
    print(sum(xxx) - (10 - p))
else:
    p = 0
    print(sum(xxx))
import numpy as np
import sys
temp = input().split()
N = int(temp[0])
M = int(temp[1])
A = []
B = []
check = False
def change(n):
  if(n=='#'):
    return True;
  return False;

for i in range(N):
  temp = input()
  A.append(list(map(change, temp)))
for i in range(M):
  temp = input()
  B.append(list(map(change, temp)))
A = np.array(A)
B = np.array(B)

for i in range(N-M+1):
  for j in range(N-M+1):
    if (B== A[i:M+j, i:M+j]).all():
      check = True
      break
  if check:
    break

if check:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

import numpy as np
import sys
temp = input().split()
N = int(temp[0])
M = int(temp[1])
A = []
B = []
check = False
def change(n):
  if(n=='#'):
    return True;
  return False;

for i in range(N):
  temp = input()
  A.append(list(map(change, temp)))
for i in range(M):
  temp = input()
  B.append(list(map(change, temp)))
A = np.array(A)
B = np.array(B)

for i in range(N-M+1):
  for j in range(N-M+1):
    if (B== A[i:M+i, j:M+j]).all():
      check = True
      break
  if check:
    break

if check:
  print("Yes")
else:
  print("No")
import fractions

N,M=map(int,input().split())
A=list(map(int,input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
  
k=1
for a in A:
  k=lcm(k,a)
if k%2==0:
  k/=2

print(int(M//k//2+M//k%2))
  



### FIXED CODE ###

import fractions

N,M=map(int,input().split())
A=list(map(int,input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
  
def kn(h):
  l=0
  while h%2==0:
    h=h//2
    l+=1
  return l
  
k=1
flag=kn(A[0]//2)
for a in A:
  a//=2
  k=lcm(k,a)
  if flag != kn(a):
    print(0);exit()
  
print(int(M//k//2+M//k%2))
s=input()
if s=="SUN":
    print(7)
elif s == "MON":
    ptint(6)
elif s == "TUE":
    print(5)
elif s == "WED":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
elif s == "SAT":
    print(1)


### FIXED CODE ###

s=input()
if s=="SUN":
    print(7)
elif s == "MON":
    print(6)
elif s == "TUE":
    print(5)
elif s == "WED":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
elif s == "SAT":
    print(1)
import bisect
import math

N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)

mini = List[A-1]
ans = 0

if List[A-1] != List[A]:
  ans = sum(List[:A])/A
  print(ans)
  print(1)

else:
  num = List.count(List[A-1])
  List = sorted(List)
  num2 = N - bisect.bisect_right(List,List[A-1])
  List = sorted(List, reverse=True)
  
  if List[0] != List[A-1]:
    B = A
  for i in range(B-A+1):
    n = num
    kosuu = A + i - num2
    ans  = ans + math.factorial(n) // (math.factorial(n - kosuu) * math.factorial(kosuu))
  
  ave = sum(List[:A])/A
  print(ave)
  print(ans)

### FIXED CODE ###

import bisect
import math
from scipy.misc import comb

N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)

mini = List[A-1]
ans = 0

if List[A-1] != List[A]:
  ans = sum(List[:A])/A
  print(ans)
  print(1)

else:
  num = List.count(List[A-1])
  List = sorted(List)
  num2 = N - bisect.bisect_right(List,mini)
  List = sorted(List, reverse=True)
  
  if List[0] != List[A-1]:
    B = A
  for i in range(B-A+1):
    n = num
    kosuu = A + i - num2
    ans  = int(ans + comb(n, kosuu, exact=True))
  
  ave = int(sum(List[:A])/A)
  print(ave)
  print(ans)
import math
N = int(input())

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

print(lcm(2, N))

### FIXED CODE ###

N = int(input())

if N%2 == 0:
    print(N)
else:
    print(2*N)
a=input()
a=a.replace("erase","")
a=a.replace("dream","")
a=a.replace("dreamer","")
a=a.replace("eraser","")
if a="":
  print("YES")
else:
  print("NO")

### FIXED CODE ###

s = input().replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "")
if s:
  print("NO")
else:
  print("YES")
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    import functools
    n=int(input())
    print(n * 2 // functools.gcd(n, 2))
resolve()


### FIXED CODE ###


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

def resolve():
    import fractions
    n=int(input())
    print(n * 2 // fractions.gcd(n, 2))
resolve()
n,m=map(int,input().split())
l=[[] for i in range(n)]
for i in range(m):
    p=[int(j) for j in input().split()]
    l[p[1]-1].append(p[0]-1)

dp=[-1 for i in range(n+1)]

def f(v):
    if dp[v]!=-1:
        return dp[v]
    p=0
    for i in l[v]:
        p=max(p,f(i)+1)
    dp[v]=p
    return dp[v]

for i in range(n):
    f(i)

print(max(dp))

### FIXED CODE ###

n,m=map(int,input().split())
l=[[] for i in range(n)]
for i in range(m):
    p=[int(j) for j in input().split()]
    l[p[1]-1].append(p[0]-1)

dp=[-1]*n
import sys
sys.setrecursionlimit(10**6)
def f(v):
    if dp[v]!=-1:
        return dp[v]
    p=0
    for i in l[v]:
        p=max(p,f(i)+1)
    dp[v]=p
    return dp[v]

for i in range(n):
    f(i)

print(max(dp))
import sys
sys.setrecursionlimit(20000)
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
ab=[list(map(int,input().split())) for i in range(n-1)]
ki=[[] for i in range(n+1)]
for i in range(n-1):
    ki[ab[i][0]].append(ab[i][1])
    ki[ab[i][1]].append(ab[i][0])
# print(ki)
kyori=[[0,0] for i in range(n+1)]
def tansaku(m, dis, hito):
    if not ki[m]:
        kyori[m][hito]=dis
        return
    elif kyori[m][hito]!=0:
        return
    else:
        kyori[m][hito]=dis
        for i in range(len(ki[m])):
            tansaku(ki[m][i], dis+1, hito)
tansaku(1,1,0)
tansaku(n,1,1)
fe,su=0,0

for i in range(1,n+1):
    if kyori[i][0]<=kyori[i][1]:
        fe+=1
    else:
        su+=1

if fe>su:
    print("Fennec")
else:
    print("Snuke")

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000000)
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
ab=[list(map(int,input().split())) for i in range(n-1)]
ki=[[] for i in range(n+1)]
for i in range(n-1):
    ki[ab[i][0]].append(ab[i][1])
    ki[ab[i][1]].append(ab[i][0])
# print(ki)
kyori=[[float("INF"), float("INF")] for i in range(n+1)]
def tansaku(m, dis, hito):
    q=[[m,dis]]
    while q:
        po=q.pop()
        for i in ki[po[0]]:
            if kyori[i][hito]>po[1]:
                kyori[i][hito]=po[1]
                q.append([i,po[1]+1])

tansaku(1,1,0)
tansaku(n,1,1)
fe,su=0,0

for i in range(1,n+1):
    if kyori[i][0]<=kyori[i][1]:
        fe+=1
    else:
        su+=1

if fe>su:
    print("Fennec")
else:
    print("Snuke")
a = int(input())
b = int(input())
print(a * b)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
n,k=map(int,input().split())
ans=0
for i in range(n+1):
  for j in range(n+1):
    for l in range(n+1):
if i+j+l==k:
  ans+=1
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
ans=0
for i in range(n+1):
  for j in range(n+1):
    if 0<=k-i-j<=n:
      ans+=1
print(ans)