peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])


ans, j = 0, M
anss = []
for i in range(1+N):
    if a[i] > K:
        break
    while 1:
        if a[i] + b[j] <= K:
            break
        j -= 1
    
    ans = max(ans, i+j)
    
            
print(ans)
# Judge status: Wrong Answer
n=int(input())
#i+j-2=cnt & i*j=n
import math
minn=100000000000000
for i in range(1,math.floor(math.sqrt(n))):
    if n%i==0:
        j=n/i
        minn=min(int(i+j-2),int(minn))
    else:
        continue
print(minn)
# Judge status: Accepted
n = input()
a_list = list(map(int, input().split())) 
cnt = 0
tmp = 0

for a in range(len(a_list)-1):
    if (a_list[a] > a_list[a+1]):
        cnt += a_list[a] -a_list[a+1]
        a_list[a+1] += a_list[a] -a_list[a+1]
        # print(cnt)

print(cnt)
# Judge status: Accepted
n = int(input())
s = input()
best_cost = s.count('.')
cost = best_cost
for i in range(n):
  if s[i] == '#':
    cost += 1
  else:
    cost -= 1
  if cost < best_cost:
    best_cost = cost

print(best_cost)
# Judge status: Accepted
N=int(input())
S=input()

def add1(S):
  cum=[0]
  for i in range(len(S)):
    if S[i]=='(':cum.append(cum[-1]+1)
    else:cum.append(cum[-1]-1)
  if min(cum)>=0:return S
  out = '('*(-min(cum))
  out += S
  return out

def add2(S):
  cum=[0]
  for i in range(len(S)):
    if S[i]=='(':cum.append(cum[-1]+1)
    else:cum.append(cum[-1]-1)
      
  if cum[-1]==0:return S
  n = cum[-1]
  out = S + ')'*n
  return out

S = add1(S)
S = add2(S)
print(S)
# Judge status: Accepted
a,b,c,d,e=map(int,input().split())
if a==0:
    print(1)
elif b==0:
    print(2)
elif c==0:
    print(3)
elif d==0:
    print(4)
else:
    print(5)
# Judge status: Wrong Answer
N, L = map(int, input().split())
s = [input() for i in range(N)]
s.sort()
print(s)
# Judge status: Accepted
def main():
    from sys import stdin
    r = stdin.readline()[:-1]
    #r = stdin.readlines()

    if r in ('3','5','7'):
        print('YES')
    else:
        print('NO')
   
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
def solve(N,A):
    ans = 0
    lis = []
    lis.append(A[0])
    a = A[0]
    for i in range(1,N):
        if len(lis)==1 or prev==0:
            prev = A[i]-a
        elif (A[i]-a)*prev<0:
            ans += 1
            lis = []
        lis.append(A[i])
        a = A[i]
    return ans
print(solve(N,A))
# Judge status: Accepted
N = int(input())
H = list(int(x) for x in input().split())
max = H[0]
ans = True

for i in range(N):
    if max < H[i]:
        max = H[i]
    elif max - 2 >= H[i]:
        ans = False
        break

if ans:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = input()
print(("Yes" if s[2] == s[3] and s[4] == s[5] else "No"))
# Judge status: Wrong Answer
S=input()

ans=0
for i in range(1<<3):
    f=S[0]
    ans=1
    for j in range(3):

        if((i>>j) & 1==1):
            ans=ans+int(S[j+1])
            f=f+'+'+S[j+1]
        else:
            ans=ans-int(S[j+1])
            f=f+'-'+S[j+1]
    print(f)
    print(ans)
    if(ans==7):
        print(f+'=7')
# Judge status: Accepted
N = int(input())
S = str(input())
Ans = []
for i in range(len(S)):
  if ord(S[i]) + N <= 90:
    Ans.append(chr(ord(S[i]) + N))
  else:
    Ans.append(chr(ord(S[i]) + N - 90 + 64))
print(''.join(Ans))
# Judge status: Accepted
S=input()
print(("No","Yes")[len(set(S))>1])
# Judge status: Accepted
N, M = map(int, input().split())
gate = [input().split() for i in range(M)]

MIN = 0
MAX = float('inf')

for i in range(M):
    MIN = max(MIN, int(gate[i][0]))
    MAX = min(MAX, int(gate[i][1]))

print(max(MAX - MIN + 1, 0))
# Judge status: Accepted
n,m = map(int,input().split())
A = [0]*n
for i in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    if a==0: A[b]+=1
    elif b==n-1: A[a]+=1
ok = False
for i in range(1,n-1):
    if A[i]>=2:
        ok = True
        break
if ok: print("POSSIBLE")
else: print("IMPOSSIBLE")
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

A = [float('Inf')] * N

for i in range(N - 1):
    A[i] = min(A[i], B[i])
    A[i + 1] = min(A[i + 1], B[i])

print(sum(A))
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
ans = pow(2 , n , 10**9+7)
mod=7+10**9
def comb(n,c,mod):
  s=1
  t=1
  for i in range(1,c+1):
    s=s*i%mod
  for j in range(n-c+1,n+1):
    t=t*j%mod
  return (t*pow(s,mod-2,mod))%mod

print(ans-1-comb(n,a,mod)-comb(n,b,mod))
# Judge status: Accepted
a, b = map(int, open(0).read().split())
print(6-a-b)
# Judge status: Wrong Answer
a,b = map(int,input().split())
s = 0
if a <= b:
    for i in range(0,b):
        s += a*(10**i)

else:
    for i in range(0,a):
        s += b*(10**i)

print(s)
# Judge status: Accepted
S = input()
S = sorted(S)
alpha = [chr(i)for i in range(97,97+26)]
ans = "None"
for W in alpha:
    if not(W in S):
        ans = W
        break
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
k=0
c=1
d=0
for i in a:
  if i != c:
    k+=1
  else:
    c+=1
    d=1
if d ==0:
  print(-1)
else:
  print(k)
# Judge status: Wrong Answer
from decimal import Decimal,ROUND_HALF_UP
n,d = map(int,input().split())
x = n/(d*2)
print(Decimal(x).quantize(0,rounding=ROUND_HALF_UP))
# Judge status: Wrong Answer
import math
a,b= map(int, input().split())
c = (a + b) / 2
print(math.floor(c))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
d=[0 for i in range(n+1)]
ans=[0 for i in range(n+1)]
for i in range(n,0,-1):
  c=0
  for j in range(i*2,n+1,i):
    c+=ans[j]
  if (c%2)^a[i-1]:
    ans[i]=1

r=""
c=0
for i in range(1,n+1):
  if ans[i]:
    c+=1
    r+=str(i)+" "
print(c)
print(r[:-1])
# Judge status: Accepted
S = input()
cur = 0
ans = 0
for i in range(len(S)):
    if S[i] == "R":
        cur += 1
    else:
        ans = max(ans, cur)
        cur = 0
ans = max(ans, cur)
print(ans)
# Judge status: Accepted
N = int(input())

p = list(map(int, input().split()))
ans = 0
for i in range(len(p)-1):
    if p[i] == i+1:
        p[i+1] = i+1
        ans += 1
if p[-1] == N: ans += 1
print(ans)
# Judge status: Accepted
def main():
    N = int(input())
    d = [0] * 100
    
    for i in range(N+1):
        s = str(i)
        d[int(s[0])*10+int(s[-1])] += 1
    
    ans = 0
    for i in range(1,10):
        for j in range(1,10):
            ans += d[i*10+j] *d[j*10+i]

    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
h,a=map(int,input().split())
print(math.ceil(h/a))
# Judge status: Accepted
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print("{}...".format(s[:k]))
# Judge status: Accepted
n,k = map(int,input().split())
r,s,p = map(int,input().split())
txt = input()

score = {"s":r,"r":p,"p":s}

bef = [-1 for i in range(k)]

ans = 0
for i in range(k):
    ans += score[txt[i]]
    bef[i] = txt[i]



for i in range(k,n):
    sup = i%k
    if bef[sup] != txt[i]:
        ans += score[txt[i]]
        bef[sup] = txt[i]
    else:
        bef[sup] = -1

print(ans)
# Judge status: Wrong Answer
s = input()
k = int(input())

if k <= len(s):
    for i in range(len(s)):
        if s[i] != '1':
            print (s[i])
            exit ()
    print (1)
    exit ()
else:
    for i in range(len(s)):
        if s[i] != '1':
            print (s[i])
            exit ()
    else:
        print ('1')
        exit ()
# Judge status: Wrong Answer
n,m = map(int,input().split())
C = [[i, list(map(int,input().split()))] for i in range(m)]
C.sort(key=lambda x:(x[1][0],x[1][1]))
D = {}
rank=1
for i in range(m):
    name=C[i][0]
    if i>1 and C[i][1][0] != C[i-1][1][0]:
        rank = 1
    D[name] = str(C[i][1][0]).zfill(6)+str(rank).zfill(6)
    rank+=1
    print(D[name])
# Judge status: Wrong Answer
n = int(input())
ans = []
for i in range(int(n**0.6)+1, 1, -1):
    if n >= i:
        n -= i
        print(i)
# Judge status: Accepted
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    a.append(a[i]-1)
    a.append(a[i]+1)
c=Counter(a).most_common()
print(c[0][1])
# Judge status: Wrong Answer
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
i=1
while True:
    if i*4>n:
        print("No")
        break
    if (n-i*4)%7==0:
        print("Yes")
        break
    i+=1
# Judge status: Wrong Answer
N = int(input())
li = list(map(int, input().split()))
li.sort()
a = li[N//2]
flag = True
for i in range (N):
    if i != N//2 and a == li[i]:
        flag = False
if flag:
     print(li[N//2]-li[N//2-1])
else:
     print(0)
# Judge status: Accepted
N = input()
flag=0
for i in N:
    if i=="7":
        flag=1

if flag == 1:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a=[input().split() for i in range(3)]
n=int(input())
b=[input() for i in range(n)]
flg=0
for k in range(3):
  if a[k][0] in b:
    if a[k][1] and a[k][2] in b:
      flg=1
  elif a[0][k] in b:
    if a[1][k] and a[2][k] in b:  
      flg=1
if a[0][0] and a[1][1] and a[2][2] in b:
  flg=1
elif a[0][2] and a[1][1] and a[2][0] in b:
  flg=1
print(['No','Yes'][flg])
# Judge status: Accepted
def calc():
    summ  = sum(A)
    low = summ / (4*M)
    newlist = [i for i in A if i >= low]
    num = len(newlist)
    
    if M <= num:
        print ("Yes")
    else:
        print ("No")

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

#N, M = 5, 2
#A = [110, 2, 20, 10, 0]
calc()
# Judge status: Accepted
from collections import Counter
n = int(input())
S = list(input())
C = Counter(S)
equ = 0
for i in range(1, (n - 1) // 2 + 1):
    for j in range(n - 2 * i):
        if S[j] != S[j + i] and S[j + i] != S[j + 2 * i] and S[j + 2 * i] != S[j]:
            equ += 1
print(C['R'] * C['G'] * C['B'] - equ)
# Judge status: Wrong Answer
S = input().strip()
C = {"N":0,"S":0,"E":0,"W":0}
for i in range(len(S)):
    C[S[i]] += 1
if C["N"]>0 and C["S"]>0:
    if (C["E"]>0 and C["W"]>0) or (C["E"]==0 and C["W"]==0):
        print("Yes")
    else:
        print("No")
elif C["N"]==0 and C["E"]==0:
    if (C["E"]>0 and C["W"]>0) or (C["E"]==0 and C["W"]==0):
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Wrong Answer
def solve():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = 0
    for a in A:
        ans += a//2
    prev = 0
    for a in A:
        new = a%2
        if new == 1:
            if prev == 1:
                ans += 1
                prev = 0
            else:
                prev = 1
        else:
            prev = 0
    return ans
print(solve())
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
h = list(map(int, input().split()))
prv = h[0]
ans = 0
c = 0
for i in range(1,n):
    if prv>=h[i]:
        c += 1
    else:
        ans = max(ans, c)
        c = 0
    prv = h[i]
ans = max(ans, c)
print(ans)
# Judge status: Accepted

N=int(input())
A=list(map(int,input().split()))
dp=[False]*(10**6+1)
A.sort()
ans=0
before_ = -1
for i in A:
  if dp[i]==False:
    for j in range(2*i,10**6+1,i):
      dp[j]=True
  if before_ == i:
      dp[i]=True
  before_=i

for i in A:
  if dp[i]==False:
    ans+=1
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
h = sorted([int(input()) for _ in range(n)])
print(min(h[i + k - 1] - h[i] for i in range(n - k + 1)))
# Judge status: Accepted
x=int(input());ans=0
while x>=500:
  x-=500
  ans+=1000
while x>=5:
  x-=5
  ans+=5
print(ans)
# Judge status: Accepted
a,b,c=list(map(int,input().split()))
if b-a==c-b:
  print ('YES')
else:
  print ('NO')
# Judge status: Accepted
from numpy import*
(n,),*d=[[*map(int,i.split())]for i in open(0)]
a,b=median(d,0)
print(int((b-a)*(2-n%2))+1)
# Judge status: Accepted
x,a,b=map(int,input().split())


if abs(x-a)<abs(x-b):
	print("A")
else:
	print("B")
# Judge status: Accepted
K = int(input())

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

ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += gcd(gcd(i+1,j+1), k+1)

print(ans)
# Judge status: Accepted
n,w=map(int,input().split())
W=[0]*n
V=[0]*n
for i in range(n):
  W[i],V[i]=map(int,input().split())
dp=[[0]*(w+1) for _ in range(n+1)]  
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-W[i-1]>=0:
      dp[i][j]=max(dp[i-1][j],dp[i-1][j-W[i-1]]+V[i-1])
    else:
      dp[i][j]=dp[i-1][j]
print(dp[n][w])
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
else:
  print('Bob')
# Judge status: Accepted
n = int(input())
lis = []
for _ in range(n):
    inp = list(map(int, input().split()))
    lis.append(inp)
lis.sort(key = lambda x:x[1])
time = 0
for i in range(len(lis)):
    time += lis[i][0]
    if time > lis[i][1]:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
C1 = list(input())
C2 = list(input())

if C1[0] == C2[2] and C1[2] == C2[0]:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
k, s = map(int, input().split())
count = 0
for a in range(k+1):
  for b in range(k+1):
      if s-k <= a + b <= s:
        count += 1
      else:
        pass
print(count)
# Judge status: Wrong Answer
# 2020/02/22
# AtCoder Beginner Contest 123 - C

# Input
n = int(input())
ae = list()
for i in range(5):
    ae.append(int(input()))

# Calc
ans = n // min(ae) + 5

# Output
print(ans)
# Judge status: Wrong Answer
N = int(input())

if N in [2,3,5,7,9]:
    print("hon")
elif N in [0, 1, 6, 8]:
    print("pon")
elif N == 3:
    print("bon")
# Judge status: Accepted
a, b = [int(i) for i in input().split()]
small = min(b, a)
range = abs(b - a)
if range / 2 != int(range / 2):
	print ('IMPOSSIBLE')
else:
	print (int(small + range / 2))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

yen = 1000

kabu = 0

for i in range(n-1):
    if a[i] < a[i+1]:
        kabu_today = yen // a[i]
        kabu += kabu_today
        yen = yen % a[i]
        
    else:
        yen += kabu * a[i]
        kabu = 0
    
#    print(yen, kabu,a[i], a[i] < a[i+1])

yen += kabu * a[n-1]
kabu = 0

print(yen)
# Judge status: Accepted
W, H, N = map(int, input().split())
x_l, x_r, y_l, y_r = 0, W, 0, H
for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1:
        x_l = max(x_l, x)
    elif a == 2:
        x_r = min(x_r, x)
    elif a ==3:
        y_l = max(y_l, y)
    else:
        y_r = min(y_r, y)
if x_l >= x_r or y_l >= y_r:
    print(0)
    exit()
print((x_r-x_l)*(y_r-y_l))
# Judge status: Accepted
a = input()
for i in range(3):
  if a[i] ==a[i+1]:
    print('Bad')
    exit()
print('Good')
# Judge status: Wrong Answer
n = int(input())
s = input()
print(n if n < 3200 else s)
# Judge status: Accepted
from collections import deque

N, K = map(int, input().split())
S = input()

q = deque()

cnt = 0
for i in range(N - 1):
    cnt += 1
    if S[i] != S[i + 1]:
        q.append(cnt)
        cnt = 0

q.append(cnt + 1)

for _ in range(K):
    if not q:
        break
    a = q.popleft()
    b = q.popleft() if q else 0
    c = q.popleft() if q else 0
    q.appendleft(a+b+c)

print(sum(q) - len(q))
# Judge status: Wrong Answer
n,k = map(int,input().split())
su = 0
mx = 0
for i in range(n):
    a,b = map(int,input().split())
    if su < k:
        su += b
        mx = max(mx,a)
    else:
        pass
print(mx)
# Judge status: Accepted
x,y=map(int, input().split())
import math
x1=math.ceil(x*12.5)
x2=math.ceil((x+1)*12.5)-1
y1=math.ceil(y*10)
y2=math.ceil((y+1)*10)-1
if x1>y2 or y1>x2:
	print (-1)
else:
	print (int(max(x1,y1)))
# Judge status: Wrong Answer
a, b = map(int, input().split())
print('Even' if a*b % 2 == 0 else 'odd')
# Judge status: Accepted
M = []
for _ in range(3):
  m = list(map(int, input().split()))
  M.append(m)

for a1 in range(100):
  b1 = M[0][0] - a1
  b2 = M[0][1] - a1
  b3 = M[0][2] - a1
  
  a2 = M[1][0] - b1
  a3 = M[2][0] - b1
  
  if (a2+b2) == M[1][1] and (a2+b3) == M[1][2] and (a3+b2) == M[2][1] and (a3+b3) == M[2][2]:
    print('Yes')
    exit()
    
print('No')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n, k = [int(x) for x in input().split()]
    a = [int(x) for x in input().split()]
    if n == k:
        print(1)
    else:
        print(n // (k-1))
        

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""



"""
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

H0 = H[0]
cnt = 0
cnt_list = []
for i in H[1:]:
  if H0 >= i:
    cnt += 1
  else:
    cnt_list += [cnt]
    cnt = 0
  H0 = i
cnt_list += [cnt]
print(max(cnt_list))
# Judge status: Accepted
S = input()
List = {'SUN':'7', 'MON':'6', 'TUE':'5', 'WED':'4', 'THU':'3', 'FRI':'2', 'SAT':'1'}
print(List[S])
# Judge status: Accepted
A,B = map(int,input().split())

print(A+B if A+B<24 else A+B-24)
# Judge status: Accepted
x = input().split()
a = int(x[0])
b = int(x[1])
count = a
if a > b:
  count -= 1
print(count)
# Judge status: Wrong Answer
n,k = map(int, input().split())
r,s,p = map(int, input().split())
T = input()
P = []
for i in range(n):
    if T[i] == 'r':
        P.append(p)
    elif T[i] == 's':
        P.append(r)
    elif T[i] == 'p':
        P.append(s)

for i in range(n-k):
    if P[i] == P[i+k]:
        P[i+k] = 0

print(sum(P))
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(200000)
 
n = int(input())
 
h = [int(i) for i in input().split()]
 
def dp(cost, p):
  if p == n-1:
    return cost
  if p < n-2:
    return min(dp(cost+abs(h[p]-h[p+1]), p+1), dp(cost+abs(h[p]-h[p+2]), p+2))
  if p == n-2:
    return dp(cost+abs(h[p]-h[p+1]), p+1)
# Judge status: Accepted
import sys
x,y=map(int, input().split())
if x==2 or y==2:
  print('No')
  sys.exit()

a=[4,6,9,11]
if (x in a) and (y in a):
  print('Yes')
elif (x not in a) and (y not in a):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,k = map(int,input().split())
input_lines = [[int(j) for j in input().split()]for i in range(n)]

input_dic = {}
for line in input_lines:
    input_dic[line[0]] = input_dic.get(line[0],0)+line[1]

for key in sorted(input_dic.keys()):
    if input_dic[key]>=k:
        print(key)
        break
    else:
        k-=input_dic[key]
# Judge status: Wrong Answer
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()
c.sort()
ans = 0
for i in range(n):
    ans += bisect.bisect_left(a,b[i])*n-(bisect.bisect_right(c,b[i]))
print(ans)
# Judge status: Wrong Answer
import math
def main():
  n = int(input())
  s = input()
  ans=0
  for i in range(0,int(n/2)+2):
    sum=0
    x=s[:i+1]
    y=s[i+1:]
    while len(x)>0:
      if x[0] in y :
        sum+=1
      x=x.replace(x[0],'')
    if sum>ans:
      ans=sum
  print(ans)
main()
# Judge status: Wrong Answer
import math
a=input().split(' ')

print(math.ceil(int(a[0])*int(a[1])/2))
# Judge status: Accepted
s = input()
if s[0]!='A' or s[2:-1].count('C')!=1:
    print('WA')    
else:
    cnt = 0
    for i in s:
        if i<'a' or 'z'<i:
            cnt += 1
    if cnt==2:
        print('AC')
    else:
        print('WA')
# Judge status: Accepted
S = input()
res = 0
l = ['A', 'C', 'G', 'T']
for i in range(len(S)):
  sub = 0
  for j in range(i, len(S)):
    if S[j] in l:
      sub += 1
    else:
      break
  if sub > res: res = sub
print(res)
# Judge status: Accepted
n = int(input())
cnt = 0
for i in range(1, n+1):
    hoge = n//i
    cnt += (hoge + 1) * i * hoge / 2
print(int(cnt))
# Judge status: Wrong Answer
S = input()
if S[2] == S[3] or S[4] == S[5]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
"""
方針
O(1)
"""
#solution:
#潜 影 蛇 手 ! !
N,A,B=pin()
if A==B:
    print(1)
elif A>B or N==1:
    print(0)
else:
    print((N-1)*(B-A))
# Judge status: Accepted
from collections import deque

k = int(input())
q = deque(range(1, 10))

for _ in range(k - 1):
    x = q.popleft()
    m = x % 10
    if m != 0:
        q.append(x * 10 + m - 1)
    q.append(x * 10 + m)
    if m != 9:
        q.append(x * 10 + m + 1)

ans = q.popleft()
print(ans)
# Judge status: Accepted
x,y,z = map(int,input().split())
isu = z
count = 0
while isu<=x-z:
    if isu+y<=x-z:
        isu += y
        isu += z
        count += 1
    else:
        break
print(count)
# Judge status: Wrong Answer
N = int(input())
H = [0] + list(map(int, input().split()))

DP = [0]*(N+1)

for i in range(1, N+1):
    if i == 1:
        DP[i] = H[1]
        continue
    if i == 2:
        DP[i] = abs(H[1] - H[2])
        continue
    c1 = abs(H[i-1] - H[i])
    c2 = abs(H[i-2] - H[i])
    DP[i] = min(DP[i-1] + c1, DP[i-2] + c2)


print(DP[N])
# Judge status: Accepted
n = int(input())
y = False
for i in range(16):
    for j in range(26):
        if i*7 + j*4 == n:
            print("Yes")  
            y = True
            break
    if y:
        break
else:
    print("No")
# Judge status: Wrong Answer
N,K,Q=map(int,input().split())
A=[int(input()) for _ in range(Q)]
L=[K-Q]*N
for i in range(Q):
    L[A[i]-1]+=1
print(L)
for j in range(N):
    if  L[j]<=0:
        print('No')
    else:
        print('Yes')
# Judge status: Wrong Answer
A,B,K = map(int,input().split())

for i in range(A,A+K):
    print(i)
for i in range(B-K+1,B+1):
    print(i)
# Judge status: Accepted
a,b,m=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
XYC=[list(map(int,input().split())) for _ in range(m)]

ans=[]
for x,y,c in XYC:
  x,y=x-1,y-1
  ans.append(A[x]+B[y]-c)
A.sort()
B.sort()
ans.append(A[0]+B[0])
ans.sort()
print(ans[0])
# Judge status: Accepted
n = int(input())
S = [input() for i in range(n)]
al = "abcdefghijklmnopqrstuvwxyz"
count = [[0 for i in range(len(al))] for j in range(n)]

for i in range(n):
  for j in range(len(al)):
    count[i][j] = S[i].count(al[j])

ans = ''
for j in range(len(al)):
  num = 999
  for i in range(n):
    if count[i][j] < num:
      num = count[i][j]
  if num != 0:
    for k in range(num):
      ans+=al[j]
      
print(ans)
# Judge status: Accepted
s = str(input())

def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

n = len(s)
sub1 = s[0:(n - 1)//2]
sub2 = s[(n + 3)//2 - 1:n + 1]

if is_kaibun(s) and is_kaibun(sub1) and is_kaibun(sub2):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N=int(input())
A=input()
print(len(set(A)))
if len(set(A))-1==N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()
if s == 'ABC':
	print('ARC')
else:
	print('ABC')
# Judge status: Accepted
import sys
k, x = [int(i) for i in sys.stdin.readline().split()]
if k * 500 >= x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m=map(int,input().split())

if m>=2*n:
    k=(m-2*n)//4
    print(n+k)
else:
    print(m//2)
# Judge status: Accepted
import sys

input = sys.stdin.readline


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

    ans = 3
    if a == b == c:
        ans = 1
    else:
        if a == b:
            ans -= 1
        if b == c:
            ans -= 1
        if c == a:
            ans -= 1
    print(ans)


if __name__ == "__main__":
    main()