Harryxun/stf_run huggingface dataset:
n=int(input())
a = list(map(int,input().split()))
i = 0
while True:
    if a[i]%2==0 and not (a[i]%3==0 and a[i]%5==0):
        print('DENIED')
        break       
    elif i==n:
        print('APPROVED')
        break
    else:
        i+=1

### FIXED CODE ###

n=int(input())
a = list(map(int,input().split()))
i = 0
while True:
    if i==n:
        print('APPROVED')
        break
    elif a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0:
        print('DENIED')       
        break       
    else:
        i+=1
s = input()
k = input()

flag = True

for i in range(len(k)):
  if s[i] != 1:
    prtin(s[i])
    flag = false
    break
    
if flag:
  print("1")


### FIXED CODE ###

s = list(input())
k = int(input())
 
flag = True

for i in range(k):
  if s[i] != "1":
    print(s[i])
    flag = False
    break

if flag:
  print("1")
import bisect

x,y,z,k = map(int, input().split())
aa = sorted(list(map(int, input().split())))[::-1]
bb = sorted(list(map(int, input().split())))[::-1]
cc = sorted(list(map(int, input().split())))[::-1]

ia,ib,ic = 0,0,0
aa_ = [aa[ia]]
bb_ = [bb[ib]]
cc_ = [cc[ic]]
while len(aa_)*len(bb_)*len(cc_) <=k:
    if ia<x and aa[ia] == min(aa[ia],bb[ib],cc[ic]):
        ia +=1
        aa_ += [aa[ia]]
    if ib<y and bb[ib] == min(aa[ia],bb[ib],cc[ic]):
        ib +=1
        bb_ += [bb[ib]]
    else:
        ic +=1
        cc_ += [cc[ic]]

score = []
for a in aa_:
    for b in bb_:
        for c in cc_:
            bisect.insort_right(score, a+b+c)
for s in score[::-1][:k]:
    print(s)

### FIXED CODE ###

x,y,z,k = map(int, input().split())
aa = sorted(list(map(int, input().split())))
bb = sorted(list(map(int, input().split())))
cc = sorted(list(map(int, input().split())))

ab = sorted(a+b for a in aa for b in bb)[:-k-1:-1]
abc = sorted(s+c for s in ab[:k] for c in cc)[:-k-1:-1]
print(*abc, sep='\n')
from collections import Counter
n = int(input())
s = input()
r = dict(Counter(s))
l = {'W': 0, 'E': 0}
if s[0] == 'W':
    a = r['E']
else:
    a = r['E'] - 1
for c in s:
    if c == 'W' and r['W'] > 0:
        l['W'] += 1
        r['W'] -= 1
    if c == 'E' and r['E'] > 0:
        l['E'] += 1
        r['E'] -= 1
    if c == 'W':
        a = max(1, min(a, l['W'] + r['E'] - 1))
    else:
        a = max(1, min(a, l['W'] + r['E']))
print(a)



### FIXED CODE ###

from collections import Counter
n = int(input())
s = input()
r = dict(Counter(s))
if 'W' not in r:
    r['W'] = 0
if 'E' not in r:
    r['E'] = 0
l = {'W': 0, 'E': 0}
a = []
for c in s:
    l[c] += 1
    r[c] -= 1
    l[c] -= 1
    a.append(l['W'] + r['E'])
    l[c] += 1
print(min(a))
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  s=S()
  k=I()

  _s=sorted(s)

  l=[]

  for i in range(3):
    for j in range(len(s)):
      if len(s)>i and _s[i]==s[j]:
        l.append(s[j])

        if len(s)-j>=2:
          l.append(s[j:j+2])

        if len(s)-j>=3:
          l.append(s[j:j+3])

        if len(s)-j>=4:
          l.append(s[j:j+4])

        if len(s)-j>=5:
          l.append(s[j:j+5])

  l=list(set(l))
  l.sort()

  return l[k-1]

print(main())


### FIXED CODE ###

# a〜z
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

s=list(input())
K=int(input())

l2=[]

a=''
for x in l:
  if x in s:
    a=x
    for i in range(len(s)):
      if s[i]==a:
        for j in range(6):
          l2.append(''.join(s[i:i+j]))

l2=list(set(l2))
l2.remove('')
l2.sort()
print(l2[K-1])
a = input().split(" ")
a[0] = int(a[0])
a[1] = int(a[1])
if a[0] > 0 and a[1] > 0:
  for i in range(0, int(a[2])):
    if a[0] > 0:
      a[0] -= 1
    else:
      if a[0] == 0 and a[1] == 0:
  	  	break
  	  else:
        a[1] -= 1
print(str(a[0]) + " " + str(a[1]))

### FIXED CODE ###

a,b,k = map(int, input().split())
x = 0 if k > a else a - k
y = b if (k - a) <= 0 else (0 if (k - a) > b else b - (k - a))
print("{} {}".format(x,y))
a, b = [int(i) for i in input().split()]

d = a // b
r = a % b
r = a / b

print("{0} {1} {2:.5f}".format(d, r, f))

### FIXED CODE ###

a, b = [int(i) for i in input().split()]
 
d = a // b
r = a % b
f = a / b
 
print("{0} {1} {2:.5f}".format(d, r, f))
n=int(input())
a=list(map(int,input().split()))
if n%2==0:
    b=sorted(a)
    i=0
    while i<len(b)-2:
        if b[i]!=b[i+1] or b[i+2]!=b[i]+2:
            print(0)
            exit()
        i+=2
    if b[-1]!=b[-2]:
        print(0)
        exit()
    print((2**(len(b)//2))%(10**9+7))
else:
    b=sorted(a)
    if b[0]!=0:
        print(0)
        exit()
    else:
        i=1
        while i<len(b)-2:
            if b[i]!=b[i+1] or b[i+2]!=b[i]+2:
                print(0)
                exit()
            i+=2
        if b[-1]!=b[-2]:
            print(0)
            exit()
        print(2**(len(b)//2)%(10**9+7))




### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if n%2==0:
    b=sorted(a)
    i=0
    while i<len(b):
        if not (b[i]==b[i+1] or b[i+2]==b[i]+2):
            print(0)
            exit()
        i+=2
    print((2**(len(b)//2))%(10**9+7))
else:
    b=sorted(a)
    if len(b)>1:
        if b[1]==0:
            print(0)
            exit()
    if b[0]!=0:
        print(0)
        exit()
    else:
        i=1
        while i<len(b):
            if not (b[i]==b[i+1] or b[i+2]==b[i]+2):
                print(0)
                exit()
            i+=2
        print(2**(len(b)//2)%(10**9+7))
A, B = map(int, input().split())
print('Yes' A % 2 and B % 2 else 'No')

### FIXED CODE ###

A, B = map(int, input().split())
print('Yes' if A % 2 and B % 2 else 'No')
n=input()
s=input()
if s[0]==s[3] and s[1]==s[4] and s[2]==s[5]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=int(input())
s=input()
f=True
if n%2==1:
    print('No')
else:
    l=n//2
    for i in range(l):
        if not s[i]==s[i+l]:
            f=False
            break
    if f:
        print('Yes')
    else:
        print('No')
for x in range(N):
  for y in range(N):
    z = N - x - y
    
    if z < 0:
      continue

    if x * 10000 + y * 5000 + z * 1000 == Y:
      print(x, y, z)
      exit()

print(-1, -1, -1)

### FIXED CODE ###


N, Y = map(int, input().split())

for x in range(N + 1):
  for y in range(N - x + 1):
    z = N - x - y
    
    if x * 10000 + y * 5000 + z * 1000 == Y:
      print(x, y, z)
      exit()

print("-1 -1 -1")
import numpy as np

N = int(input())
a = list(map(int, input().split()))
ans = list(np.zores(N))
ans2 = []
for i in range(N):
    p = N - 1 - i
    if a[p] != sum(ans[p::p + 1]) % 2:
        ans[p] = 1
        ans2.append(str(p + 1))
print(sum(ans))
print(" ".join(ans2))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
ans = [0 for i in range(N)]
ans2 = []
for i in range(N):
    p = N - 1 - i
    if a[p] != sum(ans[p::p + 1]) % 2:
        ans[p] = 1
        ans2.append(str(p + 1))
print(sum(ans))
print(" ".join(ans2))
N=input()
n=N*N*N
print(n)

### FIXED CODE ###

N=int(input())
n= N*N*N
print(n)
n = len(input())
print('x' + n)

### FIXED CODE ###

n = len(input())
print('x' * n)
a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=[int(input()) for i in range(c)]
for i in range(c):
  print(sum(b)-b[d[i][0]]+d[i][1])

### FIXED CODE ###

a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=[input().split() for i in range(c)]
for i in range(c):
  print(sum(b)-b[int(d[i][0])-1]+int(d[i][1]))
X,N = map(int,input().split())
if N >0:
  p = list(map(int,input().split()))
a = 100
ans = []
for i in range(1,101):
  if N == 0:
    ans = X
    break
  if p.count(i) == 0 and a >= abs(X - i):
    a = abs(X - i)
    ans = i
if N > 0:
  for i in range(1,101):
    if abs(X-i) == abs(X-ans) and p.count(i) == 0:
      ans = i
      break
print(ans)

### FIXED CODE ###

X,N = map(int,input().split())
if N > 0:
  p = list(map(int,input().split()))
a = 102
ans = 0
for i in range(-1,200):
  if N == 0:
    ans = X
    break
  if p.count(i) == 0 and a > abs(X - i):
    a = abs(X - i)
    ans = i
print(ans)
a,b,c,d = map(int,input().split())
B-A = abs(b - a)
C-B = abs(c - b)
C-A = abs(c - a)
if B-A <= d and C-B <=d:
    print('Yes')
elif C-A <= d:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b,c,d = map(int,input().split())
B_A = abs(b - a)
C_B = abs(c - b)
C_A = abs(c - a)
if B_A <= d and C_B <=d:
    print('Yes')
elif C_A <= d:
    print('Yes')
else:
    print('No')
n,k = map(int,input())
pn = n
while(abs(n-k)<n):
  pn = n
  n = abs(n-k)
print(pn)

### FIXED CODE ###

n,k = map(int,input().split())
ans = n%k
if (abs(ans-k) < ans):
	ans = abs(ans-k)
print(ans)
from collections import deque

N, M = map(int, input().split())
friends = [[] for _ in range(N)]

for _ in range(M):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  friends[a].append(b)
  friends[b].append(a)

check = [False] * N
ans = 0

for i in range(N):
  if check[i] == False:
    check[i] = True
    D = deque(friends[i])
    tmp = 1
    while D:
      f = D.popleft()
      if check[f] == False:
        check[f] = True
        tmp += 1
        for j in friends[j]:
          D.append(j)
    ans = max(ans, tmp)

print(ans)

### FIXED CODE ###

class UnionFind:
    def __init__(self, n):
        # 親要素のノード番号を格納。ノード番号は１から開始なのでn+1個。
        # par[x]<0の時そのノードは根で、par[x]の絶対値はグループのサイズ
        self.parents = [-1] * (n+1)

    # 親の親の...を辿って根を見つける
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            # 再度検索する時に手間がかからないよう根を繋ぎかえる
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    # xの属するグループとyの属するグループを併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        return True

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # xが属するグループのサイズを返す
    def size(self, x):
        x = self.find(x)
        return -self.parents[x]

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

UF = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    UF.union(a, b)

biggest = 0
for i in range(1, n+1):
    biggest = max(biggest, UF.size(i))

print(biggest)
v = [int(n) for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")


### FIXED CODE ###

s = [n for n in input()];r = len(set(s)) == 2 and ((s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]));print("Yes" if r else "No")
def attk(HP,Magic,D0):
    T = HP // Magic[0][0]
    MD0 = T * Magic[0][1]
    MD1 = (T+1) * Magic[0][1]
    Z = HP % Magic[0][0]
    ND = Magic[0][1]
    if Z == 0:
        return MD0
    if len(Magic) == 1:
        return MD1
    Magic.pop(0)
    A = attk(Z,Magic,ND)
    if D0 > MD0+A:
        if MD1 > MD0+A:
            return MD0+A
        else:
            return MD1
    else:
        return D0

H,N = map(int,input().split())
A =[]
for i in range(N):
    a,b = map(int,input().split())
    A.append((a,b,a/b))
#print(A)
B = sorted(A, key=lambda s: s[1]) 
C = sorted(B, key=lambda s: s[2], reverse=True) 
#print(C)

for i in range(N-1):
    if C[N-1-i][2] ==C[N-2-i][2]:
        C.pop(N-1-i)
#print(C)
TDMAX = (H // C[0][0])*C[0][1]
if (H%C[0][0])!=0:
    TDMAX += C[0][1]
TD = attk(H,C,TDMAX)
print(TD)

### FIXED CODE ###

H,N = map(int,input().split())
Magic =[]
A =[]
E =[]
for i in range(N):
    a,b = map(int,input().split())
    Magic.append((a,b))
    A.append(a)
    E.append(a/b)
MAX_A = H+max(A)
E_MIN = min(E)
WORST = int(MAX_A/E_MIN) +2
#print(Magic)
#print(MAX_A)
#print(WORST)
DP = [[WORST] * (MAX_A+1) for i in range(N)]
for i in range(N):
    if i == 0:
        for j in range(1,MAX_A//Magic[0][0]+1):
            DP[0][j*Magic[0][0]] = Magic[0][1]*j
    else:
        for j in range(Magic[i][0]-1):
            DP[i][j] = DP[i-1][j]
        DP[i][Magic[i][0]] = min(DP[i-1][Magic[i][0]],Magic[i][1])
        for j in range(Magic[i][0]+1,(MAX_A+1)):
            DP[i][j]=min(DP[i-1][j],DP[i-1][j-Magic[i][0]]+Magic[i][1],DP[i][j-Magic[i][0]]+Magic[i][1])
            if j % Magic[i][0] == 0:
                DP[i][j]=min(DP[i][j],((j//Magic[i][0]) * Magic[i][1]))
print(min(DP[N-1][H:MAX_A]))
A = [int(x) for x in input().split()]
N = int(input())

flag = True
count=0
while(flag):
    for i in range(N):
        if A[i]%2 == 1 :
            flag=False
            break
        else:
            A[i] /= 2
    if flag:
        count += 1

print(count)


### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]


flag = True
count=0
while(flag):
    for i in range(N):
        if A[i]%2 == 1 :
            flag=False
            break
        else:
            A[i] /= 2
    if flag:
        count += 1

print(count)
a,b = map(int, input())
c = a*b
if c%2 = 0,
    print("Even")
else print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
c = a*b
if c % 2:
    print("Odd")
else:
    print("Even")
N = int(input())
    ai = [int(input()) for i in range(N)]
    
    now = 1
    count = 0
    for i in range(N):
        count = count + 1
        now = ai[now-1]
        if now == 2:
            print(count)
            exit()
    print(-1)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys

def main():
	N = int(input())
	ai = [int(input()) for i in range(N)]
	
	now = 1
	count = 0
	for i in range(N):
		count = count + 1
		now = ai[now-1]
		if now == 2:
			print(count)
			exit()
	print(-1)
	
if __name__ == "__main__":
	main()
n = str(input())

for char in chars:
	if int(char) == 7:
		n = 1

	if n != 0:
		break

if n == 0:
	print('No')
else:
	print('Yes')

### FIXED CODE ###

chars = str(input())
n = 0

for char in chars:
	if int(char) == 7:
		n = 1

	if n != 0:
		break

if n == 0:
	print('No')
else:
	print('Yes')
a = x*x*x
 print "%d" & a

### FIXED CODE ###

x = input()
ans = x**3
print ans
import sys
input=sys.stdin.readline

H,W=map(int, input().split())
C = [[] for i in range(H)]

for h in range(H):
    C[h] = list(input().strip())
#print(*C)

for h in range(H):
    for w in range(W):
        if C[w][h] == "#":
            if h == 0 or (h>0 and C[h-1][w] == "."):
                if w == 0 or (w>0 and C[h][w-1] == "."):
                    if w == W-1 or (w+1<W and C[h][w+1] == "."):
                        if h == H-1 or (h+1<h and C[h+1][w] == "."):
                            print("No")
                            exit()
print("Yes")


### FIXED CODE ###

import sys
input=sys.stdin.readline

H,W=map(int, input().split())
C = [[] for i in range(H)]

for h in range(H):
    C[h] = list(input().strip())
#print(*C)

for h in range(H):
    for w in range(W):
        if C[h][w] == "#":
            if h == 0 or (h>0 and C[h-1][w] == "."):
                if w == 0 or (w>0 and C[h][w-1] == "."):
                    if w == W-1 or (w<W-1 and C[h][w+1] == "."):
                        if h == H-1 or (h<H-1 and C[h+1][w] == "."):
                            print("No")
                            exit()
print("Yes")
n=int(input())
ans=float(inf)
for x in range(1,min(n,10**5)):
    if n%x==0:
        m=len(str(x))*len(str(n//x))
        ans=min(ans,m)
print(ans)

### FIXED CODE ###

n=int(input())
ans=10**20
for x in range(1,10**5+1):
    if n%x==0:
        ans=min(ans,max(len(str(x)),len(str(n//x))))
print(ans)
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define MOD 1000000007
#define endl "\n"
#define sz(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
#define trace(x) cerr << #x << ": " << x << " " << endl;
#define prv(a) for(auto x : a) cout << x << ' ';cout << '\n';
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define OTP(s) cout<<s<<endl;
#define FOR(i,j,k,l) for(int i=j;i<k;i+=l)
#define REP(i,j) FOR(i,0,j,1)
inline ll add(ll a, ll b){a += b; if(a >= MOD)a -= MOD; return a;}
inline ll sub(ll a, ll b){a -= b; if(a < 0)a += MOD; return a;}
inline ll mul(ll a, ll b){return (ll)((ll) a * b %MOD);}
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

ll min(ll a,ll b)
{
    return a>b?b:a;
}
ll max(ll a,ll b)
{
    return a>b?a:b;
}

ll n;
double q[3000][3000];
double p[10000];
int main()
{
    IOS
    cin>>n;
    REP(i,n)
    {
        cin>>p[i+1];
    }
    double prod=1;

    q[0][0]=1;
    FOR(i,1,n+1,1)
    {
        prod*=0;
        q[0][i]=prod;
    }
    prod=1;
    REP(i,n)
    {
        prod*=p[i+1];
        q[i+1][0] = prod;
    }
    FOR(i,1,n+1,1)
    {
        FOR(j,1,i+1,1)
        {
            q[i][j] = p[i]*q[i-1][j] + (1-p[i])*q[i-1][j-1];
        }
    }
    // REP(i,n+1)
    // {
    //     REP(j,n+1)
    //     {
    //         cout<<q[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }
    double ans = 0;
    REP(i,(n-1)/2+1)
    {
        ans+=q[n][i];
    }
    cout<<fixed<<setprecision(12)<<ans<<endl;
}

### FIXED CODE ###

n = int(input())
p = list(map(float, input().split()))
q=[]
q.append([1])
for i in range(n):
    q[0].append(0)
prod = 1.0
for i in range(1,n+1):
    prod*=p[i-1]
    q.append([prod])

for i in range(1,n+1):
    for j in range(1,n+1):
        try:
            q[i].append(p[i-1]*q[i-1][j] + (1-p[i-1])*q[i-1][j-1])
        except:
            print(i)
            print(j)
        #print(q)
ans = 0.0
for i in range(0,(n-1)//2+1):
    ans+=q[n][i]
print(ans)
N = int(input())
A = [int(input()) for _ in range(N)]

if N == 2:
    print("\n".join(map(str, A[::-1])))
else:
    for i in range(N):
        if i == N - 1:
            print(max(A[:-1]))
        else:
            print(max(*A[:i], *A[i+1:]))

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]

if N == 2:
    print("\n".join(map(str, A[::-1])))
else:
    a = sorted(A)
    maxv1 = a[-1]
    maxi1 = A.index(maxv1)
    maxv2 = a[-2]

    for i in range(N):
        if i == maxi1:
            print(maxv2)        
        else:
            print(maxv1)
"""
map(int,input().split())

X = input().split()
x = []
for i in range(0,len(X)):
    x.append(X[i])

"""
def search(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

N = int(input())

ball = []

for n in range(N):
    x,y = map(int,input().split(" "))
    ball.append((x,y))

#最適p,q計算
pqList = []
pqCount = []
for i in range(0,N):
    for j in range(0,N):
        if i != j:
           i_x = ball[i][0]
           i_y = ball[i][1]
           j_x = ball[j][0]
           j_y = ball[j][1]
           s = search(pqList,(i_x-j_x,i_y-j_y))
           if s != -1 :
               pqCount[s] += 1
           else:
               pqList.append((i_x-j_x,i_y-j_y))
               pqCount.append(1)

print(int(N - (max(pqCount))))


### FIXED CODE ###

"""
map(int,input().split())

X = input().split()
x = []
for i in range(0,len(X)):
    x.append(X[i])

"""

def search(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

N = int(input())



ball = []

for n in range(N):
    x,y = map(int,input().split(" "))
    ball.append((x,y))

if N== 1:
    print(1)
    exit()

#最適p,q計算
pqList = []
pqCount = []
for i in range(0,N):
    for j in range(0,N):
        if i != j:
           i_x = ball[i][0]
           i_y = ball[i][1]
           j_x = ball[j][0]
           j_y = ball[j][1]
           s = search(pqList,(i_x-j_x,i_y-j_y))
           if s != -1 :
               pqCount[s] += 1
           else:
               pqList.append((i_x-j_x,i_y-j_y))
               pqCount.append(1)

print(int(N - (max(pqCount))))
K, X = map(int, input().split)
a = 500*K

if a >= X:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

K, X = map(int, input().split())
a = 500*K

if a >= X:
  print("Yes")
else:
  print("No")
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())

li = list(map(int,stdin.readline().rstrip().split()))

li1 = []
li2 = []

for i in range(n):
    if i % 2 == 0:
        li1.append(li[i])
    else:
        li2.append(li[i])

li1.sort()
li2.sort()

lin = []
lin2 = []

for key, value in groupby(li1):
    lin.append((key,len(list(value))))
for key, value in groupby(li2):
    lin2.append((key,len(list(value))))

lin.sort(key=lambda x:(x[1]))
lin2.sort(key=lambda x:(x[1]))

point = 0

if lin[-1][0] == lin2[-1][0] and lin[-1][1] == lin2[-1][1]:
    if len(lin) == 1:
        print(n//2)
    else:
        if lin[-2][1] >= lin2[-2][1]:
            print(n-lin[-2][1]-lin2[-1][1])
        else:
            print(n-lin[-1][1]-lin2[-2][1])

elif lin[-1][0] == lin2[-1][0]:
    if len(lin) == 1:
        print(n//2-lin2[-2][1])
    elif len(lin2) == 1:
        print(n//2-lin[-2][1])
    else:
        if lin[-2][1] >= lin2[-2][1]:
            print(n-lin[-1][1]-lin2[-2][1])
        else:
            print(n-lin[-2][1]-lin2[-1][1])
else:
    print(n-lin[-1][1]-lin2[-1][1])

### FIXED CODE ###

from sys import stdin

s = stdin.readline().rstrip()
ns = ""
for i in s:
    if i =="1":
        ns += "9"
    else:
        ns += "1"

print(ns)
N=int(input())
A=list(map(int,input().split()))
answer=0
for n in range(N-1):
    if A[n]>A[n+1]:
        sa=A[n]-A[n+1]
        answer+=sa
        A[n+1]=A[n]
if A[-2]>A[-1]:
    answer+=A[-2]-A[-1]
print(answer)


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
answer=0
if N==1:
    print(0)
else:
    for n in range(N - 1):
        if A[n] > A[n + 1]:
            sa = A[n] - A[n + 1]
            answer += sa
            A[n + 1] = A[n]
    if A[-2] > A[-1]:
        answer += A[-2] - A[-1]
    print(answer)
N, Y = map(int, input().split())
c = [-1,-1,-1]
for i in range(N+1):
    for j in range(N+1):
            if N-i-k >=0 and 10000*i + 5000*j + 1000*(N-i-k) == Y:
                c = [i,j,N-i-k]
                break

print(c[0],c[1],c[2])

### FIXED CODE ###

N,Y = map(int, input().split())
c = [-1,-1,-1]
for i in range(N+1):
    for j in range(N+1):
        a = N - i - j
        if a >= 0 and (10000*i + 5000*j + 1000*a) == Y:
            c = [i,j,a]
            break
print(c[0],c[1],c[2])
n = int(input())

max_1 = 0
max_2 = 0
max_index = 0

for i in range(n):
  	item = int(input())
    if item >= max_1:
        max_1, max_2 = item, max_1
        max_index = i
    elif item > max_2:
        max_2 = item

for i in range(n):
    ans = max_2 if i == max_index else max_1
    print(ans)



### FIXED CODE ###

n = int(input())

max_1 = 0
max_2 = 0
max_index = 0

for i in range(n):
    item = int(input())
    if item >= max_1:
        max_1, max_2 = item, max_1
        max_index = i
    elif item > max_2:
        max_2 = item

for i in range(n):
    ans = max_2 if i == max_index else max_1
    print(ans)
line = input();
N, X, T = line.split(" ")

return (N + X - 1) // X * T

### FIXED CODE ###

line = input()

N, X, T = (int(x) for x in line.split(" "))

print((N + X - 1) // X * T)