peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
from itertools import permutations

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

a = range(1, n+1)
t, u = 0, 0
for i, s in enumerate(permutations(a)):
    if s == p: t = i
    elif s == q: u = i

print(abs(t - u))
# Judge status: Accepted
N = input()

hon = ['2', '4', '5', '7', '9']
pon = ['0', '1', '6', '8']
bon = ['3']

if N[-1] in hon:
    print('hon')
elif N[-1] in pon:
    print('pon')
else:
    print('bon')
# Judge status: Accepted
from math import ceil
s = int(input())
print(0, 0, 10 ** 9, 1, abs(s - ((10 ** 9) * ceil(s / 10 ** 9))), ceil(s / 10 ** 9))
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
s = {}
for i in range(n):
    s[i] = a.count(i)
for i in range(n):
    if s[i] == 0:
        s.pop(i)
    else:
        continue
cnt = 0
while len(s) > k:
    cnt = cnt + min(s.values())
    s.pop(min(s, key=s.get))
print(cnt)
# Judge status: Wrong Answer
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = A%10
if a>=5:
  a = 10-a
b = B%10
if b>=5:
  b = 10-b
c = C%10
if c>=5:
  c = 10-c
d = D%10
if d>=5:
  d = 10-d
e = E%10
if e>=5:
  e = 10-e

answer = min(A+B+b+C+c+D+d+E+e, A+a+B+C+c+D+d+E+e, A+a+B+b+C+D+d+E+e)
finalanswer = min(answer, A+a+B+b+C+c+D+E+e, A+a+B+b+C+c+D+d+E)
print(finalanswer)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
ans = 0
tmp = 1
for i in range(N):
    if a[i] != tmp:
        ans += 1
    else:
        tmp += 1
if ans == N:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(n*x + (n>k)*(n-k)*(y-x))
# Judge status: Wrong Answer
n = int(input())
lst = list(map(int, input().split()))

for i in range(2, n+1):
  print(lst.count(i))
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = float('inf')
for i in range(M):
    x, y, c = map(int, input().split())
    ans = min(ans, a[x-1] + b[y-1] - c)
ans = min(ans, min(a) + min(b))
print(ans)
# Judge status: Wrong Answer
def myAnswer(X:int,Y:int) -> int:
   if(X == 0):
      return Y if(Y >= 0) else abs(Y) + 1
   if(X > 0):
      return abs(Y - X) if (Y >= 0) else abs(-1 * Y - X) + 1
   if(X < 0):
      if(Y == 0):
         return abs(X)
      return 2 + abs(Y - X) if(Y < 0) else abs(Y - (-1*X)) + 1

def modelAnswer():
   return
def main():
   X,Y = map(int,input().split())
   print(myAnswer(X,Y))
if __name__ == '__main__':
   main()
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
# a,b=map(int,input().split())
# l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
count=0
for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0, c+1):
            if i*500+j*100+k*50==x:
                count+=1
print(count)
# Judge status: Accepted
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif a <= 5:
    print(0)
else:
    print(b//2)
# Judge status: Accepted
S = input()
N = len(S) + 1
a = [0] * N

for i in range(0, N-1):
    #print(a)
    if S[i] == "<":
        a[i+1] = a[i] + 1

for i in range(N-2, -1, -1):
    #print(a)
    if S[i] == ">":
        a[i] = max(a[i+1] + 1, a[i])

#print(a)
print(sum(a))
# Judge status: Wrong Answer
lst = list(map(int, input().split()))
for i in lst:
    if i == 0:
        print(i)
        exit()
# Judge status: Wrong Answer
import math
n=int(input())
c=[list(map(int,input().split())) for i in range(n)]

a=0

for i in range(n):
    if i==0:
        a+=((c[-1][0]-c[0][0])**2+(c[-1][1]-c[0][1])**2)**(0.5)
    else:
        a+=((c[i][0]-c[i-1][0])**2+(c[i][1]-c[i-1][1])**2)**(0.5)

b=((n-1)*(math.factorial(n)))//n #1区間の出現回数

print((a*b)/(math.factorial(n)))
# Judge status: Wrong Answer
n = list(map(int, list(input())))
ans = 0
c_in = 0

while n:
    s = n.pop()

    if 0 <= s <= 4:
        ans += s + c_in
        c_in = 0
    elif s == 5:
        if c_in:
            ans += 4
        else:
            ans += s
    elif 6 <= s <= 9:
        ans += 10 - s - c_in
        c_in = 1


ans += c_in
print(ans)
# Judge status: Accepted
def main():
    a = list(map(int, input().split()))
    a.sort()
    A, B, C = a[0], a[1], a[2]
    ans = 0
    ans += C-B
    A = A + ans
    B = B + ans
    ans += (B-A) // 2
    A += ((B-A) // 2) * 2
    if A != B:
        ans += 2
    print(ans)
main()
# Judge status: Wrong Answer
W, H, N = list(map(int, input().split()))

X = [0] * N
Y = [0] * N
A = [0] * N

for _ in range(N):
    X[_], Y[_], A[_] = list(map(int, input().split()))

#solve
xb = 0
xe = W
yb = 0
ye = H

for _ in range(N):
    if A[_] == 1:
        xb = X[_]
    elif A[_] == 2:
        xe = X[_]
    elif A[_] == 3:
        yb = Y[_]
    else:
        ye = Y[_]

ans = (xe - xb) * (ye - yb)
print(ans if ans >= 0 else 0)
# Judge status: Accepted
n=int(input())
d={2:0}
if n==1: print(0);exit()
nc=n
while n%2==0:
    d[2]+=1
    n=n//2
for i in range(3,int(nc**0.5)+1,2):
    if n==1: break
    if n%i!=0:continue
    d[i]=0
    while n%i==0:
        d[i]+=1
        n=n//i
if n!=1: d[n]=1 
sm=0
for x in d:
    if d[x]==0: continue
    y=1
    ywork=3
    while ywork<=d[x]:
        y+=1
        ywork+=y+1
    sm+=y
print(sm)
# Judge status: Wrong Answer
A, B, C, X, Y = map(int, input().split())
Sum = A * X + B * Y

if A+B > 2*C:
  if X < Y:
    if 2*C <= B:
      Sum = C * Y
    else:
      Sum = C * X + B * (Y - X)
  elif Y < X:
    if 2*C <= A:
      Sum = C * X
    else:
      Sum = C * Y + A * (X - Y)
  else:
    Sum = C * X

print(Sum)
# Judge status: Accepted
a,b,c,d=list(map(str,input()))

def solve(m,n):
    if eval(m)==7:
        print(m+"=7")
        exit(0)
    elif n<7:
        solve(m,n+2)
        solve(m[:n]+"-"+m[n+1:],n+2)

solve(a+"+"+b+"+"+c+"+"+d,1)
# Judge status: Wrong Answer
x=int(input())
ans=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x: ans=b**p
        else: break
print(ans)
# Judge status: Accepted
s = str(input())
t = str(input())

for i in range(len(s)):
    if(t == s[i:]+s[:i]):
        print('Yes')
        exit()

print('No')
# Judge status: Wrong Answer
import math
n = int(input())
x = []
y = []
for i in range(n):
    a,b = (int(x) for x in input().split())
    x.append(a)
    y.append(b)

ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        d=math.sqrt( (x[i]-x[j])**2 + (y[i]-y[j])**2 )
        ans += d

if n == 2:
    print(ans)
else:
    print(ans*(n-1)/n)
# Judge status: Accepted
n=int(input())
alist = []
for i in range(n):
    a,b=input().split()
    alist.append([a, int(b)])
blist=sorted(alist,key=lambda x:x[1],reverse=True)
blist.sort(key=lambda x:x[0])
for i in range(n):
  print(alist.index(blist[i])+1)
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
ans = 0

import collections
c = collections.Counter(A)

two = []
four = []

for i in sorted(set(A)):
    a = c[i]
    
    if a > 1:
        two.append(i)
        
    if a > 3:
        four.append(i)
        
if len(two) > 0:
    two = sorted(two)
    ans = two[-1] * two[-2]
    
if len(four) > 0:
    ans = max(max(four)**2,ans)
    
print(ans)
# Judge status: Accepted
S = input()
l = []
for i in S:
  l.append(i)
if l[-1] == 's':
    l.append('es')
    print("".join(j for j in l))
else:
    l.append('s')
    print("".join(j for j in l))
# Judge status: Wrong Answer
s = str(input())
t = str(input())
ans = 10000
for i in range(len(s) - len(t) + 1) : 
  cnt = 0
  for j in range(len(t)) : 
    if s[i + j] != t[j] : 
      cnt += 1
  ans = min(ans, cnt)
# Judge status: Accepted
n = int(input())
if n % 2 == 0:
    print(n // 2)
else:
    print((n // 2) + 1)
# Judge status: Accepted
from math import ceil

N,K = map(int,input().split())
A = list(map(int,input().split()))
print(ceil((N-1)/(K-1)))
# Judge status: Wrong Answer
import math
x,n  = map(int,input().split())
if n==0:
    print(x)
    exit()
p = [int(i) for i in input().split()]


max_ = max(p)



a= [i+1 for i in range(max_)]
aa = [-max_+i+1 for i in range(max_)]
m=0
for i in p:
    a[i-1]=100000
min_=100000

for j in aa:
    b=abs(j-x)
    if min_ > b:
        min_=b
        m = j
for i in a:
    b = abs(i-x)
    if min_ > b:

        min_=b
        m = i
print(m)
# Judge status: Accepted
d, t, s = map(int, input().split())
if d <= t * s:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()

mini = 10 ** 9
for i in range(N - K + 1):
    mini = min(mini, abs(H[i] - H[i + K - 1]))

print(mini)
# Judge status: Accepted
#!/usr/bin/env python3

s = list(str(input()))

count_0 = 0
count_1 = 0
for i in s:
    if i == "0":
        count_0 += 1
    else:
        count_1 += 1

print(min(count_0, count_1)*2)
# Judge status: Wrong Answer
n,m =  map(int,input().split())

a = [0]*m
b = [0]*m
checks = [0]*n
checkg = [0]*n
for i in range(m):
    a[i],b[i] = map(int,input().split())
    if a[i]== 1:
        checks[b[i]]=1
    if b[i]== n:
        checkg[a[i]]=1
ans = 0
for i in range(n):
    if checks[i] == checkg[i] == 1:
        ans = 1
if ans :
    print("POSSIBLE")
else:
    print("IMPOSSIBILE")
# Judge status: Wrong Answer
X,Y,Z=map(int,input().split())
print(str(Z)+" "+str(Y)+" "+str(X))
# Judge status: Accepted


n, m = map(int, input().split())
votes = [int(i) for i in input().split()]
z = sum(votes)
if sum(map(lambda x: x >= z / (4*m), votes)) >= m:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = input()
ans = 9999
for i in range(len(s)-2):
  ans = min(ans,abs( int(s[i:i+3]) - 753 ))
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for _ in range(M)]

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

C = int(A+B)

if float.is_integer(math.sqrt(C)):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
flag = True
 
for a in A:
    if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
        flag = False
 
print("APPROVED" if flag else "DENIED")
# Judge status: Accepted

a,b = map(int,input().split())
diff = abs(b-a)
r = 0

for i in range(1,diff+1):
    r += i
print(r-b)
# Judge status: Accepted
n,y = map(int, input().split())

a = -1
b = -1
c = -1
n1 = min(y // 10000, n)
n2 = min(y // 5000, n)
for i in range(n1+1):
    for j in range(n2+1-i):
        money = 10000 * i + 5000 * j + 1000 * (n - i - j)
        if y == money:
            a = i
            b = j
            c = n - i - j
            break;


print(str(a)+" ",str(b)+" ",str(c))
# Judge status: Wrong Answer
N, K = map(int, input().split())
D = list(map(int, input().split()))
E = [x for x in range(10) if x not in D]
# print(N, K, D, E)

def is_valid(n, d):
    q = (n // (10 ** d)) % 10
    # print(q)
    return q in E

ans = N
d = 1
while d < len(str(N)):
    if is_valid(ans, d):
        d += 1
    else:
        ans += 10**(d - 1)

print(ans)
# Judge status: Wrong Answer
A,B = map(int,input().split())
print(max(A,B)+max(A,B)-1)
# Judge status: Wrong Answer
from bisect import bisect


n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(int, input().split()))
c = sorted(map(int, input().split()))
print(sum(len(a[bisect(a, i):]) * len(c[bisect(c, i):]) for i in b))
# Judge status: Wrong Answer
abc=list(map(int,input().split()))
print(sum(abc)-min(abc))
# Judge status: Wrong Answer
N=int(input())

l=[]

for i in range(N):
  x,y=[int(x) for x in input().rstrip().split()]
  l.append([x,y])

l=sorted(l,key=lambda x:x[1] )

now=0
ans=0
for i in range(N):
  now+=l[i][0]
if now<=l[N-1][1]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
a,b,c,d = input()
for i in ["+","-"]:
    for j in ["+","-"]:
        for k in ["+","-"]:
                if eval(a+i+b+j+c+k+d) == 7:
                    print(a+i+b+j+c+k+d+ "=7")
# Judge status: Accepted
# def gcd(a, b):
#     if b == 0:
#         return a
#     return gcd(b, a % b)

from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
ans = 1001001001
g = a[0]
for i in range(1,n):
    g = gcd(a[i], g)
    ans = min(ans, g)

print(ans)
# Judge status: Accepted
S = input()
K = int(input())
ans = 1
onecount = 0
for i in S:
    if i == "1":
        onecount += 1
        continue
    else:
        if onecount >= K:
            ans = 1
        else:
            ans = i
        break
print(ans)
# Judge status: Accepted
K,N = map(int,input().split())
L = [i for i in map(int,input().split())]
L.append(L[0]+K)
dist = []
for i in range(N):
    dist.append(abs(L[i+1]-L[i]))
print(sum(dist)-max(dist))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
mini = 0
maxi = 0
M = b % c
m = a % c
res = (b-M)/c+(m-a)/c
int(res)
print(res)
# Judge status: Accepted
N = int(input())
for x in range(1, 50000):
    if int(x * 1.08) == N:
        print(x)
        exit()
print(":(")
# Judge status: Accepted
import math

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

MOD = 10**9 + 7

if abs(N-M) > 1:
    ans = 0
elif abs(N-M) == 1:
    ans = math.factorial(N) * math.factorial(M)
else:
    ans = math.factorial(N) * math.factorial(M) * 2

print(ans % MOD)
# Judge status: Accepted
N, M = input().split(' ')
N = int(N)
M = int(M)
min = 1
max = N
for i in range(M):
  l, m = input().split(' ')
  l = int(l)
  m = int(m)
  if min>m or max<l:
    print(0)
    break 
  if min < l:
    min = l
  if max > m:
    max = m
else:
  print(max-min+1)
# Judge status: Wrong Answer
import sys
from bisect import bisect_right

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    color = [A[0]]

    for i in range(1, N):
        idx = bisect_right(color, A[i])
        if idx == 0:
            color = [A[i]] + color
        else:
            color[idx - 1] = A[i]

    print(len(color))


if __name__ == "__main__":
    main()
# Judge status: Accepted
# ABC129B

n = int(input())
w = list(map(int, input().split()))
s = sum(w)
Min = s
for i in range(n - 1):
    # s1 = sum(w[:i + 1])
    # Min = min(abs(s1 - (s - s1)), Min)
    Min = min(abs(2*sum(w[:i + 1]) - s), Min)
print(Min)
# Judge status: Accepted
n=2
s=[""]*n
a=[0]*n
s[:]=input().split()
a[:]=map(int,input().split())
u=input()
for ii in range(n):
  if s[ii]==u:
    a[ii]-=1
    break
print(" ".join([str(ii) for ii in a]))
# Judge status: Accepted
n=int(input())

c=0
for i in range(0,n//4+1):
  for j in range(0,n//7+1):
    if 4*i+7*j==n:
      c+=1

if c==0:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
z,a,b=map(int,input().split());print('AB'[abs(z-a)>abs(z-b)])
# Judge status: Accepted
n,m = map(int,input().split())
x = [0]*(m+1)
for i in range(n):
    d = list(map(int,input().split()))
    for i in d[1:]:
        x[i] += 1
print(x.count(n))
# Judge status: Accepted
C = []
for _ in range(2):
    C.append(input())

if C[0][0] == C[1][2] and C[0][1] == C[1][1] and C[0][2] == C[1][0]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n = int(input())
as_ = map(int, input().strip().split())

num_mul2 = 0
num_mul4 = 0

for a in as_:
    if a % 4 == 0:
        num_mul4 += 1
    elif a % 2 == 0:
        num_mul2 += 1

d = n - num_mul4 * 2 - (num_mul2 // 2) * 2
if num_mul4 > 0:
    d -= 1

if d <= 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
import bisect
input = sys.stdin.readline
n,q = map(int,input().split())
s = list(input())
lr = [list(map(int,input().split())) for _ in range(q)]
ac = []
for i in range(n-1):
  if s[i] == "A" and s[i+1] == "C":
    ac.append(i)
for i in range(q):
  print(bisect.bisect_left(ac,lr[i][1]-1)-bisect.bisect_left(ac,lr[i][0]-1))
# Judge status: Accepted
s=input()
ans=[]

for i in s:
    if i=="0":
        ans.append(0)
    elif i=="1":
        ans.append(1)
    else:
        if ans==[]:
            pass
        else:
            ans.pop()

print(*ans,sep="")
# Judge status: Accepted

def main():
    dict_str = ["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"]
    C = input()
    res_idx = dict_str.index(C)
    print(dict_str[res_idx+1])


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import deque

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

ok = False
for v in G[0]:
    s = G[v]
    if n-1 in s:
        ok = True

if ok:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N,K=map(int,input().split())

ablist=[]
for _ in range(N):
  a,b=map(int,input().split())
  ablist.append((a,b))
ablist.sort()
  
s=0
for a,b in ablist:
  s+=b
  if s>=K:
    print(a)
    break
# Judge status: Accepted
import sys
s=(input())
t=(input())
ss=s+s
n=len(s)
flag=False
for i in range(0,n):
    if ss[i:i+n]==t:
        print("Yes")
        sys.exit()
print("No")
# Judge status: Accepted
import itertools

n=int(input())
p=tuple(int(x) for x in input().split())
q=tuple(int(x) for x in input().split())

l=list(itertools.permutations(range(1,n+1), n))

print(abs(l.index(p)-l.index(q)))
# Judge status: Accepted
k = int(input())

from collections import deque

queue = deque([1,2,3,4,5,6,7,8,9])
n = 0
while n < k:
  n += 1
  x = queue.popleft()
  if x%10 != 0:
    queue.append(x*10+x%10-1)
  queue.append(x*10+x%10)
  if x%10 != 9:
    queue.append(x*10+x%10+1)

print(x)
# Judge status: Accepted
n,d=(int(x) for x in input().split())
a=(d*2+1)
if n%a==0:
  print(int(n/a))
else:
  print(int(n/a)+1)
# Judge status: Accepted
A = [0] * 5
for i in range(5):
    A[i] = int(input())

from itertools import permutations

Z = list(range(5))

Z = list(permutations(Z))

ans = float("inf")
for z in Z:
    time = 0
    for i,x in enumerate(z):
        time += A[x]
        if i == 4:
            break
        while time % 10 != 0:
            time += 1
    ans = min(ans, time)

print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
A=list(map(int,input().split()))
sum_A=sum(A)
ans=N-sum_A
if ans >=0:
    print(ans)
else:
    print(-1)
# Judge status: Wrong Answer
import math
a,b,h,m=map(int,input().split())
h=(12-h)/12
m=(60-m)/60


ax=a*math.sin(2*math.pi*h)
ay=a*math.cos(2*math.pi*h)
bx=b*math.sin(2*math.pi*m)
by=b*math.cos(2*math.pi*m)



c=math.sqrt(abs(ax-bx)**2+abs(ay-by)**2)
print(c)
# Judge status: Wrong Answer
l,r,d = map(int,input().split())
print((r-l+1)/d)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=[0]*(max(a)+2)

for i in range(n):
  b[a[i]]+=1
  b[a[i]-1]+=1
  b[a[i]+1]+=1
print(max(b))
# Judge status: Accepted
N=int(input())
d=list(map(int,input().split()))
d.sort()
sum=d[N//2]-d[N//2-1]
print(sum)
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]

p = sorted(p)
q = sorted(q)
#r = sorted(r)
tmp = sorted(p[-x:] + q[-y:] + r)
ans = sum(tmp[-(x+y):])

print(ans)
# Judge status: Wrong Answer
n=int(input())
s=input()
t=''
for i in s:
  if ord(i)+n%25>90:
    t+=chr(ord(i)+n%25-26)
    
  else:
    t+=chr(ord(i)+n%25)
    
print(t)
# Judge status: Wrong Answer
N = int(input())
print(N / 2 + N % 2)
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
ans = []

for i in range(ty-sy):
    ans.append('U')
for i in range(tx-sx):
    ans.append('R')
for i in range(abs(sy-ty)):
    ans.append('D')
for i in range(abs(sx-tx)):
    ans.append('L')

ans.append('L')
for i in range(ty+1-sy):
    ans.append('U')
for i in range(tx-sx+1):
    ans.append('R')
ans.append('D')
ans.append('R')
for i in range(abs(sx-tx)+1):
    ans.append('L')
ans.append('U')
print(*ans, sep='')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
oc, fc = 0, 0
for i in range(N):
	if A[i] % 4 == 0:
		fc += 1
	elif A[i] % 2 == 1:
		oc += 1
if fc >= oc:
	print('Yes')
elif (fc + 1 == oc) and (fc + oc == N):
	print('Yes')
else:
	print('No')
# Judge status: Accepted
n,k,q = map(int,input().split())
A = [0] * n

for i in range(q):
    A[int(input())-1] += 1
    
for i in A:
    if k-(q-i) > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=[input() for i in range(n)]
ml=[input() for i in range(m)]
for i in range(n-m+1):
  for j in range(n-m+1):
    for h in range(m):
      if ml[h]!=l[i][j:j+m]:break
    else:print("Yes");exit()
print("No")
# Judge status: Accepted
q, h, s, d = map(int, input().split())
n = int(input())
min_1l = min(q*4, h*2, s)
min_2l = min(min_1l*2, d)

print(min(n*min_1l, (n//2)*min_2l + (n%2)*min_1l))
# Judge status: Accepted
import bisect

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

A.sort()
B.sort()
C.sort()
ans = 0

for b in B:
    cnt_a = bisect.bisect_left(A, b)
    cnt_c = N - bisect.bisect_right(C, b)
    ans += cnt_a * cnt_c

print(ans)
# Judge status: Wrong Answer
x = int(input())
if 360 % x == 0:
    print(360//x)
else:
    print(360//abs(360-x))
# Judge status: Accepted
n = int(raw_input())
elems = [(e,i) for i,e in enumerate(map(int, raw_input().split(' ')))]
elems.sort()
for a,b in elems:
	print b+1,
# Judge status: Wrong Answer
n = int(input())
l=list(map(int ,input().split()))
cnt=0
for i in range(n):
    if l[i]%4==0 or l[i]==1:
        cnt+=1
if n%2==0:
    if cnt>=n//2:
        print("Yes")
    else:
        print("No")
else:
    if cnt>=n//2+1:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
a, b = map(int,input().split())
from fractions import gcd
print(gcd(a,b))
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

No = 0

tmp = H[0]-1
for i in range(1,N):
  if tmp < H[i]:
    tmp = H[i]-1
  elif tmp == H[i]:
    tmp = H[i]
  else:
    No = 1
    break

print("Yes" if No == 0 else "No")
# Judge status: Wrong Answer
D = int(input())

print("christmas" + "\tEve" * (25-D))
# Judge status: Accepted
s = input()
F = 0 < int(s[:2]) < 13
S = 0 < int(s[2:]) < 13
print("AMBIGUOUS" if F*S else "YYMM" if S else "MMYY" if F else "NA")
# Judge status: Accepted
S = input()
print('yes') if len(S) == len(set(list(S))) else print('no')
# Judge status: Accepted
N = int(input())
a_list = list(map(int, input().split()))

count = 0
for i in range(1,N+1):
    if a_list[i-1] % 2 == 1 and i % 2 == 1:
        count += 1
print(count)
# Judge status: Accepted
K, S = map(int, input().split())

count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S - x - y <= K:
            count += 1
                
print(count)
# Judge status: Accepted
import sys
from itertools import accumulate

n, k, *aaa = map(int, sys.stdin.buffer.read().split())

for _ in range(k):
    bbb = [0] * (n + 1)
    for i in range(n):
        a = aaa[i]
        bbb[max(0, i - a)] += 1
        bbb[min(n, i + a + 1)] -= 1

    aaa = list(accumulate(bbb))
    aaa.pop()

    if all(a == n for a in aaa):
        break

print(*aaa)
# Judge status: Accepted
from collections import defaultdict

N = int(input())
D = list(map(int, input().split()))

MOD = 998244353

p = defaultdict(int)
for d in D:
    p[d] += 1

if p[0] == 1 and D[0] == 0:
    ans = 1
    for i in range(max(D)):
        ans *= p[i] ** p[i + 1]
        ans %= MOD
        if ans == 0:
            break

    print(ans)

else:
    print(0)
# Judge status: Wrong Answer
def iroha():
    a, b, c = map(int, input().split())
    if a == b == c:
        print("1")
    elif a != b != c:
        print("3")
    else:
        print("2")

if __name__ == "__main__":
    iroha()