Harryxun/stf_run huggingface dataset:
import math
a, b, c, d = map(int, input().split())
cCan = b//c-(a-1)//c
dCan = b//d-(a-1)//d
cdSK = c*d//math.gcd(c, d)
cdCan = b//cdSK-(a-1)//cdSK
print(int(b-(a-1)-cCan-dCan+cdCan))

### FIXED CODE ###

import fractions
a, b, c, d = map(int, input().split())
cCan = b//c-(a-1)//c
dCan = b//d-(a-1)//d
cdSK = c*d//fractions.gcd(c, d)
cdCan = b//cdSK-(a-1)//cdSK
print(int(b-(a-1)-cCan-dCan+cdCan))
#C問題
#UnionFind
def find(A,x):
    p = A[x]
    if p == x:
        return x
    a = find(A,p)
    A[x] = a
    return a
 
def union(A, x, y):
    if find(A,x) > find(A,y):
        bx, by = find(A,y), find(A,x)
    else:
        bx, by = find(A,x), find(A,y)
    A[y] = bx
    A[by] = bx

import heapq

H,W = map(int,input().split())
PQ = []
for i in range(W+H+1):
    if i == W:
        continue
    pq = int(input())
    heapq.heappush(PQ,[pq,i,i+1])


uf = UnionFind(H+W+2)
a = W+1
b = H+1
ans = 0
V = [i for i in range(H+W+2)]

while PQ:
    edge = heapq.heappop(PQ)
    w,s,t = edge[0],edge[1],edge[2]
    if find(V,s) != find(V,t):
        union(V,s,t)
        if s < W+1: #P
            ans+=w*b
            a-=1
        else:#Q
            ans+=w*a
            b-=1
            
print(ans)



### FIXED CODE ###

#C問題
#UnionFind
def find(A,x):
    p = A[x]
    if p == x:
        return x
    a = find(A,p)
    A[x] = a
    return a
 
def union(A, x, y):
    if find(A,x) > find(A,y):
        bx, by = find(A,y), find(A,x)
    else:
        bx, by = find(A,x), find(A,y)
    A[y] = bx
    A[by] = bx

import heapq

W,H = map(int,input().split())
PQ = []
for i in range(W+H+1):
    if i == W+1:
        continue
    pq = int(input())
    heapq.heappush(PQ,[pq,i,i+1])

#print(PQ)
w = W+1
h = H+1
ans = 0
V = [i for i in range(H+W+2)]

while PQ:
    e,s,t = heapq.heappop(PQ)
    if find(V,s) != find(V,t):
        union(V,s,t)
        if s < W: #P
            ans+=(e*h)
            w-=1
        else:#Q
            ans+=(e*w)
            h-=1
            
print(ans)
n=int(input())
a=[int(input()) for i in range(n)]
count=0
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      count=count+1
  else:
    count=count+1
if count==n:
  print("APPROVED")
else:
  print("DENIED")

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      count=count+1
  else:
    count=count+1
if count==n:
  print("APPROVED")
else:
  print("DENIED")
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;cin>>N;
  vector<int>A(N);
  for(int &a:A)cin>>a;
  sort(A.begin(),A.end(),greater<int>());
  map<int,int>m;
  int ans=0;
  for(int a:A){
    if(m.count(a)&&m[a]>0)m[a]--,ans++;
    else m[(1<<(32-__builtin_clz(a)))-a]++;
  }
  cout<<ans<<endl;
}


### FIXED CODE ###

import math
N = int(input())
A = sorted([int(_) for _ in input().split()], reverse=True)
dp = {}
for a in A:
    dp[a] = dp.get(a, 0) + 1
ans = 0
for a in A:
    if dp[a]:
        dp[a] -= 1
        if dp.get(2**int(math.log2(a) + 1) - a, 0) > 0:
            dp[2**int(math.log2(a) + 1) - a] -= 1
            ans += 1
print(ans)
import sys
input = sys.stdin.readline
import numpy as np

def print_sub(A, Ones, m, c):
    A = np.array(A)
    A = A -Ones
    print(m -len(np.nonzero(A)[0]))
    c +=1
    if c < m:
        return print_sub(A, Ones, m, c)
    else:
        return

n= int(input())
A = [int(a) for a in input().split()]
Ones = np.array([1]*(n-1))
c = 0
print_sub(A, Ones, n-1, c)

print("0")


### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
A = [int(a) for a in input().split()]

sub_list = [0] *n

for a in A:
  sub_list[a-1] +=1

for i in range(n):
  print(sub_list[i])
import numpy as np
n=int(input())
l=list(map(int,input().split()))
l.sort()
L=np.array(l)
cnt=0
for i in range(n-2):
  for j in range(i+1,n-1):
    cnt+=np.count_nonzero(L[j+1:]<L[i]+L[j])
print(cnt)

### FIXED CODE ###

import sys
input = sys.stdin.readline
from bisect import bisect_left

def main():
    n=int(input())
    l=sorted(list(map(int,input().split())))
    ans=0
    for i in range(n-2):
        a=l[i]
        for j in range(i+1,n-1):
            ans+=bisect_left(l,a+l[j])-j-1
    print(ans)

if __name__ == '__main__':
    main()
import sympy
 
n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=sympy.factorint(P)
    res=1
    for b,c in a.items() :
        if c >= 4 : res *= b
    return res
 
print(C(n,p))

### FIXED CODE ###

n,p = list(map(int,input().split())) 
i = a = o = 1
m = round(p**(1/n))
for i in range(m,0,-1):
    a = i**n
    if p%a==0:
        print(i)
        exit()
# -*- coding: utf-8 -*-
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n = input()
monster = list(map(int,input().split()))

print(gcd_list(monster))


### FIXED CODE ###

# -*- coding: utf-8 -*-

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

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


if n==1:
    print(x[0])
else:
    element = gcd(x[0], x[1])
    if n==2:print(element)
    else:
        for i in range(2,n):
            element=gcd(element,x[i])
        print(element)
N,T=(int(i) for i in input().split())
t = [int(i) for i in input().split()]
a=0
for b in range(N-1):
    if (t[b+1] - t[b]) < T:
        a = a + t[b+1] - t[b]
    else:
        a = a + T
a = a+T
print(a)

### FIXED CODE ###

A,B,C=(i for i in input().split())
if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")
N=input()
A=list(map(int,input().split()))
for i in range(N):
  if A[i]%2==0:
    if A[i]%3!=0 and A[i]%5!=0:
      print('DENIED')
      exit()
print('APPROVED')
      

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  if A[i]%2==0:
    if A[i]%3!=0 and A[i]%5!=0:
      print('DENIED')
      exit()
print('APPROVED')
N = int(input())
print(sum(list(range(0,N))))

### FIXED CODE ###

N = int(input())
print(N*(N-1)//2)
from collections import deque

h,w = map(int,input().split())
maze = []

cnt_wall = 0
for _ in range(h):
    s = input()
    cnt_wall += s.count('#')
    maze.append(s)


def bfs(d):
    que = deque([(0,0,1)])
    visited = [[False]*w for _ in range(h)]
    table = [[-1]*w for _ in range(h)]
    while que:
        x,y,cnt = que.popleft()
        visited[x][y] = True
        table[x][y] = cnt
        for i,j in ((1,0),(0,1),(-1,0),(0,-1)):
            nx,ny = x+i,y+j
            if 0<=nx<w and 0<=ny<h:
                if (visited[nx][ny] == False):
                    if (d[nx][ny]=='.'):
                        que.append((nx, ny,cnt+1))
    return table[h-1][w-1]


min_step = bfs(maze)
if min_step < 0:
    print(-1)
else:
    print(h*w - min_step - cnt_wall)

### FIXED CODE ###

from collections import deque

def bfs(maze,visited,sy,sx,gy,gx):
    Step = ([1,0],[0,1],[-1,0],[0,-1])
    
    que = deque([[sx,sy]])
    visited[sx][sy] = 1
    
    while que:
        y,x = que.popleft()
        if [y,x] == [gy,gx]:
            return visited[y][x]
        for j,k in Step:
            ny,nx = y+j , x+k
            if 0 <= ny <= gy and 0 <= nx <= gx:
                if maze[ny][nx] == '.' and visited[ny][nx] == INF:
                    visited[ny][nx] = visited[y][x] + 1
                    que.append([ny,nx])


h,w = map(int,input().split())
maze = [input().strip() for _ in range(h)]

cntSharp = 0
for i in range(h):
    cntSharp += maze[i].count('.')

INF = 10**5
visited = [[INF]*w for _ in range(h)]

sx,sy = 0,0
gy,gx = h-1,w-1

minStep = bfs(maze,visited,sy,sx,gy,gx)
print(cntSharp - minStep if visited[gy][gx] != INF else -1)
import numpy as np

MOD = 10**9+7

D,T,E = input().split()
n= int(D)

arr = np.zeros((n+1,n+1),dtype=np.int16)
for i in range(3,n+1):
    arr[0,i] = 1

for i in range(1,n+1):
    sum_ = 0
    for j in range(3*i,n+1):
        sum_ += arr[i-1,j]
        sum_ %= MOD
        if j+3 >= n + 1:
            break
        arr[i,j+3] = sum_








### FIXED CODE ###

D,T,S = [int(i) for i in input().split()]
out = 'Yes' if D <= T * S else 'No'
print(out)
# ABC138D
def dfs(kol,adj,v,p):
    for nv in adj[v]:
        if nv==p:
            continue
        else:
            dfs(kol,adj,nv,v)
    kol[v]+=[v]
    if p!=-1:
        kol[p]+=kol[v]
N,Q=map(int,input().split())
adj=[[] for i in range(N)]
for i in range(N-1):
    a,b=map(int,input().split())
    adj[a-1]+=[b-1]
    adj[b-1]+=[a-1]
    
ct=[0]*N
kol=[[] for i in range(N)]

dfs(kol,adj,0,-1)

for i in range(Q):
    p,x=map(int,input().split())
    for j in kol[p-1]:
        ct[j]+=x

print(ct[0], end="")
for i in range(1,N):
    print(" {}".format(ct[i]),end="")
print("")

### FIXED CODE ###

# ABC138D

import sys
input=sys.stdin.readline
sys.setrecursionlimit(1000000000)

def dfs(adj,v,p,px,x,ct):
    x+=px[v]
    for nv in adj[v]:
        if nv==p:
            continue
        else:
            dfs(adj,nv,v,px,x,ct)
    ct[v]+=x

def main():
    N,Q=map(int,input().split())
    adj=[[] for i in range(N)]
    for i in range(N-1):
        a,b=map(int,input().split())
        adj[a-1]+=[b-1]
        adj[b-1]+=[a-1]
    px=[0]*N
    for i in range(Q):
        p,x=map(int,input().split())
        px[p-1]+=x
        
    ct=[0]*N
    dfs(adj,0,-1,px,0,ct)
    
    
    print(ct[0], end="")
    for i in range(1,N):
        print(" {}".format(ct[i]),end="")
    print("")
    
if __name__=="__main__":
    main()
mod=10 ** 9 + 7

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

def power(x,n):
    if n==0:
        return 1
    elif n%2==0:
        half=power2(x,n//2)
        return half**2 %mod
    else:
        half=power2(x,(n-1)//2)
        return  half**2 * x %mod

def binomial(n,k):
    x=1
    y=1
    for i in range(k):
        x=x*(n-i)%mod
        y=y*(i+1)%mod
    return x*pow(y,mod-2,mod)%mod

ans=(power(2,n) - binomial(n,a) -binomial(n,b))%mod

print(ans)

### FIXED CODE ###

mod=10 ** 9 + 7

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

def power(x,n):
    if n==0:
        return 1
    elif n%2==0:
        half=power(x,n//2)
        return half**2 %mod
    else:
        half=power(x,(n-1)//2)
        return  half**2 * x %mod

def binomial(n,k):
    x=1
    y=1
    for i in range(k):
        x=x*(n-i)%mod
        y=y*(i+1)%mod
    return x*power(y,mod-2)%mod

ans=(power(2,n)-1 - binomial(n,a) -binomial(n,b))%mod

print(ans)
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
f=min(a,b,c,d,e)
g=max(a,b,c,d,e)
h=g-f
if h <= k:
  print('Yay')
else:
  print(':(')

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=min(a,b,c,d,e)
g=max(a,b,c,d,e)
h=g-f
if h <= k:
  print('Yay!')
else:
  print(':(')
M = int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
is_prime = [True] * (ma + 1)
for i in A:
    if not is_prime[i]:
        continue
    for j in range(i * 2, ma + 1, i):
        is_prime[j] = False
k=[i for i in range(ma + 1) if is_prime[i]]
N=[]
if A[0] !=A[1]:
    N.append(A[0])
for i in range(1,len(A)-1):
    if A[i-1]!=A[i] and A[i]!=A[i+1]:
        N.append(A[i])
if A[-2] != A[-1]:
    N.append(A[-1])
s=set(k) & set(N)
print(len(s))

### FIXED CODE ###

M = int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
is_prime = [True] * (ma + 1)
for i in A:
    if not is_prime[i]:
        continue
    for j in range(i * 2, ma + 1, i):
        is_prime[j] = False
k=[i for i in range(ma + 1) if is_prime[i]]
N=[]
if len(A)==1:
    print(1)
else:
    if A[0] !=A[1]:
        N.append(A[0])
    for i in range(1,len(A)-1):
        if A[i-1]!=A[i] and A[i]!=A[i+1]:
            N.append(A[i])
    if A[len(A)-2] != A[len(A)-1]:
        N.append(A[len(A)-1])
    s=set(k) & set(N)
    print(len(s))
import collections
n = int(input())
alist = list(map(int,input().split()))
adic = collections.Counter(alist)
for k,v in adic.items():
  if v == 1:
    del(adic[k])
sort_adic = sorted(adic.items(), reverse = True, key = lambda x:x[1])
li = list(sort_adic.items())
print(li[0][1]*li[1][1])

### FIXED CODE ###

import collections
n = int(input())
alist = list(map(int,input().split()))
adic = collections.Counter(alist)
A = [0,0]
for i in adic:
  if adic[i] > 1:
    A.append(i)
  if adic[i] > 3:
    A.append(i)
sortedA = sorted(A)
print(sortedA[-1]*sortedA[-2])
def gcd(a,b):
  if a==0:
    return b
  return gcd(b%a,a)
a,b = map(int,input().split())

print((a*b)//gcd(a,b))

### FIXED CODE ###

x = int(input())
y = int(input())
k = [1,2,3]
k.remove(x)
k.remove(y)
print(k[0])
from math import gcd 
n=int(input())
mod = 10**9+7
count = {}

num=0
for _ in range(n):
    a,b = map(int,input().split())
    if a==0 and b==0:
        num+=1
        continue
    if a*b != 0:
        g=gcd(a,b)*(b//abs(b))
    elif a != 0:
        g=a
    else:
        g=b
        
    x=a//g,b//g
    count[x]=count.get(x,0)+1
        
mem=set()
ans=1
for (x,y),z in count.items():
    k=(-1*x//abs(x)*y,abs(x))
    if k in mem:
        continue
    mem.add((x,y))
    ans*=(pow(2,z)+pow(2,count.get(k,0))-1)
    ans%=mod

print((ans+num-1)%mod)

### FIXED CODE ###

from math import gcd 
n=int(input())
mod = 10**9+7
count = {}

num=0
for _ in range(n):
    a,b = map(int,input().split())
    if a==0 and b==0:
        num+=1
        continue
    if a*b != 0:
        g=gcd(a,b)*(b//abs(b))
    elif a != 0:
        g=a
    else:
        g=b
        
    l=a//g,b//g
    count[l]=count.get(l,0)+1
        
mem=set()
ans=1
for (x,y),z in count.items():
    if x*y==0:
        k=(y,x)
    else:
        k=(-1*x//abs(x)*y,abs(x))
    if k in mem:
        continue
    mem.add((x,y))
    ans*=(pow(2,z)+pow(2,count.get(k,0))-1)
    ans%=mod

print((ans+num-1)%mod)
x = input()
x = int(x)

answer = []
for p in range(2, 10):

    for i in range(1, x):
        if i**p > x:
            answer.append((i-1)**p)
            break
        elif pow(i, p) == x:
            answer.append(i**p)
            break

print(max(answer))

### FIXED CODE ###

X = int(input())

beki = 0
for p in range(2, 9):
    tmp = 0
    b = 1
    while tmp <= X:
        tmp = b**p
        if tmp > X:
            break
        beki = max(tmp, beki)
        b += 1

print(beki)
#141d
from collections import deque

N,M = map(int, input().split()) #1≤N,M≤10^5
A = list(map(int, input().split()))
A.sort()
discounted = deque()
#高橋くんは N 個の品物を 1個ずつ順番に買う予定です。
#i番目に買う品物の値段は Ai円です。
#高橋くんは M枚の割引券を持っています。品物を買う際に割引券を好きな枚数使うことができます。
#X円の品物を買う際に Y 枚の割引券を使った場合、その品物を X/(2^Y)円(小数点以下切り捨て)で買うことができます。
#最小で何円あれば全ての品物を買うことができるでしょうか。

#→高額なものに割引券を使った方が良い

highest = A.pop(-1)
discounted.append(highest/2)

for i in range(M-1):
    if len(A)>0:
        if discounted[0] > A[-1]:
            discounted.append((discounted.popleft())/2)
        else:
            discounted.append((A.pop(-1))/2)
    else:
        discounted.append((discounted.popleft())/2)

discounted = [math.floor(discounted_price) for discounted_price in list(discounted)]

print(sum(A)+sum(discounted))

### FIXED CODE ###

#141d
from collections import deque
import bisect
import math

N,M = map(int, input().split()) #1≤N,M≤10^5
A_list = list(map(int, input().split()))

#→高額なものに割引券を使った方が良い
if len(A_list) > 1:
    A_list.sort(reverse=False)
    highest = A_list.pop()
    next_highest = A_list[-1]

    discounted_deque = deque()

    while 1:
        use_tickets = math.ceil(math.log(highest/next_highest)/math.log(2))
        if use_tickets == 0:
            use_tickets = 1
        elif use_tickets > M:
            use_tickets = M
            
        highest /= pow(2,use_tickets)
        M -= use_tickets
        
        if M!= 0:
            discounted_deque.appendleft(highest)
            
            if len(A_list) > 0:
                if A_list[-1] > discounted_deque[-1]:
                    highest = A_list.pop()
                else:
                    highest = discounted_deque.pop()
            else:
                highest = discounted_deque.pop()
                
            if len(A_list) > 0 and len(discounted_deque) > 0:
                if A_list[-1] > discounted_deque[-1]:
                    next_highest = A_list[-1]
                else:
                    next_highest = discounted_deque[-1]
            elif len(A_list) == 0 and len(discounted_deque) > 0:
                next_highest = discounted_deque[-1]
            elif len(A_list) > 0 and len(discounted_deque) == 0:
                next_highest = A_list[-1]
            
        else:
            A_list.append(highest)
            break

    A_list = [int(A) for A in A_list]
    discounted_list = [int(B) for B in discounted_deque]
    
    print(sum(A_list)+sum(discounted_list))
else:
    A_list[-1] = A_list[-1]//(pow(2,M))
    print(A_list[-1])
N, M, X=map(int, input().split())
list=[0]*(N+1)
for i in range(M):
    list[map(int, input().split())]=1


### FIXED CODE ###

N, M, X=map(int, input().split())
sum=sum(int(i)<X for i in input().split())
print(min(sum, M-sum))
import sys
input = sys.stdin.readline

# C - Subarray Sum
n, k, s = map(int, input().split())
ans = ''
str_s = str(s)

if s < pow(10, 9):
	str_another = str(s + 1)
else:
	str_another = 1

for i in range(n):
	if i < k:
		ans += str_s + ' '
	else:
		ans += str_another + ' '

print(ans[:len(ans)-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline

# C - Subarray Sum
n, k, s = map(int, input().split())
ans = ''
str_s = str(s)

if s < pow(10, 9):
	str_another = str(s + 1)
else:
	str_another = '1'

for i in range(n):
	if i < k:
		ans += str_s + ' '
	else:
		ans += str_another + ' '

print(ans[:len(ans)-1])
a=int(input())
print(800*n-(n//15)*200)

### FIXED CODE ###

a=int(input())
print(800*a-(a//15)*200)
nums = [int(i) for i in input().split()]
sort_nums = sort.nums
" ".join(sort_nums)

### FIXED CODE ###

nums = [int(i) for i in input().split()]
sort_nums = sorted(nums)
nums_str = map(str,sort_nums)
print(' '.join(nums_str))
N, X = [int(nx) for nx in input().split()]
x = [abs(int(xx) - X) for xx in input().split()]

while len(x) > 1:
  x2 = []
  mn_x = min(x)
  for n in range(N):
    mod = x[n] % mn_x
    if mod != 0:
      x2.append(mod)
  x2.append(mn_x)
  x = x2
print(x)

### FIXED CODE ###

N, X = [int(nx) for nx in input().split()]
x = [abs(int(xx) - X) for xx in input().split()]

while len(x) > 1:
  x2 = []
  mn_x = min(x)
  for n in range(len(x)):
    mod = x[n] % mn_x
    if mod != 0:
      x2.append(mod)
  x2.append(mn_x)
  x = x2
  
ans = x[0]
print(ans)
#! python3
# coding:utf-8

n = int(input())
for i in range(1,n+1):
    cnt=0

    for x in range(1,n+1):
        if x > 100:
            continue
        for y in range(1,n-x+1):
            for z in range(1,n-x-y+1):
                eq = x**2 + y**2 + z**2 + x*y + y*z + z*x
                   
                if eq == i:
                    cnt+=1
    print(cnt)

### FIXED CODE ###

#! python3
# coding:utf-8

l,r,d = map(int,input().split())
cnt = 0
for i in range(l,r+1):
    if i%d == 0:
        cnt+=1

print(cnt)
n, m = int(input()).split()

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

### FIXED CODE ###


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

if m == n:
    print('Yes')
else:
    print('No')
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
a_ = set(a)
x = Counter(a)
y = []
for i in a_:
    t = x[i]
    y.append(t*(t-1)//2)
res = sum(y)
for i in a:
    t = x[i]
    t_ = y[i-1]
    print(res-t_+(t-1)*(t-2)//2)

### FIXED CODE ###

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
a_ = set(a)
x = Counter(a)
y = {i:x[i]*(x[i]-1)//2 for i in a_}

res = sum(y.values())
for i in a:
    t = x[i]
    t_ = y[i]
    print(res-t_+(t-1)*(t-2)//2)
n = int(input())
if n ==1:
    print(Hello World)
else:
    a = int(input())
    b = int(input())
    print(a+b)


### FIXED CODE ###

n = int(input())
if n ==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)
n=int(input())
a=[input() for _ in range(n)]
l={}
for i in range(n):
    if a[i] in l:
        l.remove(a[i])
    else:
        l.append(a[i])
#print(l)
print(len(l))

### FIXED CODE ###

n=int(input())
a=[input() for _ in range(n)]
l={}
for i in a:
    if i in l:
        del l[i]
    else:
        l[i]=0
print(len(l))
ls = 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
K = int(input())
print(ls[K]+1)

### FIXED CODE ###

ls = 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
K = int(input())
print(ls[K-1])
n = input()
        
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
        
for i in range(0, n):
   mk, num = raw_input().split()
      if mk == 'S':
         S[int(num)-1] = 0
      elif mk == 'H':
         H[int(num)-1] = 0
      elif mk == 'C':
         C[int(num)-1] = 0
      elif mk == 'D':
         D[int(num)-1] = 0
        
for i in range(1, 13):
   if S[i] != 0:
      print 'S '+ str(S[i])
       
for i in range(0, 13):
   if S[i] != 0:
      print 'H '+ str(H[i])
       
for i in range(0, 13):
   if S[i] != 0:
      print 'C '+ str(C[i])
       
for i in range(0,13):
   if S[i] != 0:
      print 'D '+ str(D[i])

### FIXED CODE ###

n=input()
  
s=range(1,14)
h=range(1,14)
c=range(1,14)
d=range(1,14)
   
for i in range(n):
   m, k=raw_input().split()
   if m == 'S':
      s[int(k)-1] = 0
   elif m == 'H':
      h[int(k)-1] = 0
   elif m == 'C':
      c[int(k)-1] = 0
   elif m == 'D':
      d[int(k)-1] = 0
  
for i in range(0, 13):
   if s[i] != 0:
      print 'S '+str(s[i])
  
for i in range(0, 13):
   if h[i] != 0:
      print 'H '+str(h[i])
  
for i in range(0, 13):
   if c[i] != 0:
      print 'C '+str(c[i])
  
for i in range(0, 13):
   if d[i] != 0:
      print 'D '+str(d[i])
H, W=int(HW[0]),int(HW[1])
h, w=int(hw[0]),int(hw[1])
ans=(W-w)*(H-h)
print(ans)

### FIXED CODE ###

H, W=map(int, input().split())
h, w=map(int, input().split())
ans=(W-w)*(H-h)
print(ans)
n,q=map(int,input().split())
child=[[] for _ in range(n+1)]
point=[0 for _ in range(n+1)]
for i in range(n-1):
    a,b=map(int,input().split())
    child[a].append(b)

for i in range(q):
    p,x=map(int,input().split())
    point[p]+=x

ans=[0 for _ in range(n+1)]
def dfs(vertex,pt):
    pt_v=pt+point[vertex]
    ans[vertex]=pt_v
    child_v=child[vertex]
    for i in range(len(child_v)):
        dfs(child_v[i],pt_v)


dfs(1,0)

for i in range(1,n+1):
    print(ans[i],end=" ")


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**9)

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

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

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

point=[0 for _ in range(n)]
que=deque()
que.append(0)
used=set()
used.add(0)
point[0] += v_counter[0]

while(len(que)>0):
    ind=que.popleft()
    relate=link[ind]
    for i in relate:
        if(i in used):
            continue
        else:
            point[i] += point[ind] + v_counter[i]
            que.append(i)
            used.add(i)

print(*point)
N,K,Q=map(int, input().split())
A=[int(input()) for i in range(Q)]
from collections import Counter
A=Counter(A)
B=list(A.most_common())
B.sort(key=lambda x:x[0])
for i in range(N):
  if (Q - B[i][1])< K:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N,K,Q=map(int, input().split())
A=[int(input()) for i in range(Q)]
from collections import Counter
A=Counter(A)
B=list(A.most_common())
#B.sort(key=lambda x:x[0])
C = [0]*N
for i in B:
  C[i[0]-1]=i[1]
for i in range(N):
  if (Q - C[i])< K:
    print("Yes")
  else:
    print("No")
N = input()
print("Yes" if N % sum(map(int,N)) == 0 else "No")

### FIXED CODE ###

N = input()
print("Yes" if int(N) % sum(map(int,N)) == 0 else "No")
X = list(map(int, input().split()))
if X[0] > 100 or X[1] > 100:
  no_print
if X[1] > X[0]*4 or X[1] < X[0]*2:
  no_print
if X[1] % 2 == 1:
  no_print
 
number_check
  
def no_print():
  print(No)
  exit
 
def number_check():
  turtle = X[0]
  crane = 0
  i = 0
  while i < X[0]:
    result = turtle * 4 + crane * 2 
    if result > X[1]:
      crane += 1
      turtle -= 1
    if result == X[1]:
      print(Yes)
      exit
    if result < X[1]:
      turtle += 1
      crane -= 1
    i += 1  

### FIXED CODE ###

X = list(map(int, input().split()))
count = 1
for I in X:
  if I == 0:
    print(count)
    exit
  count += 1