Harryxun/stf_run huggingface dataset:
import sys
for n in sys.stdin:
    n=int(n)
    x=[0]*n
    x[2]=1
    flag = 0
    for i in xrange(3,n):
        flag = 0
        for j in [p for p in xrange(1,(i/2)+1) if x[p]!=0]:
            if (i%j == 0):
                flag = 1
                break
        if flag==0:
            x[i]=1
    print len([v for v in xrange(n) if x[v]==1])

### FIXED CODE ###

import sys
n=999999
prime = [1]*(n+1)
(prime[0],prime[1])=(0,0)
for i in [v for v in xrange(2,n+1) if v*v<n+1]:
        for j in xrange(i*i,n+1,i):
            prime[j]=0

for inp in sys.stdin:
    print prime[:int(inp)+1].count(1)
memo = {}

def judge(x):
	if x < 0:
		return False
	elif x == 0:
		return True
	else:
		if x not in memo:
			memo[x] = judge(x - 100) or judge(x - 101) or judge(x - 102) or judge(x - 103) or judge(x - 104) or judge(x - 105)
		return memo[x]


if __name__ == "__main__":
	X = int(input())
	if judge(X):
		print(1)
	else:
		print(0)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

memo = {}

def judge(x):
	if x < 0:
		return False
	elif x == 0:
		return True
	else:
		if x not in memo:
			memo[x] = judge(x - 100) or judge(x - 101) or judge(x - 102) or judge(x - 103) or judge(x - 104) or judge(x - 105)
		return memo[x]


if __name__ == "__main__":
	X = int(input())
	if judge(X):
		print(1)
	else:
		print(0)
import sys


x,k,d=map(int,input().split())

x=abs(x)
syou = x//d
if k<=syou:
  print(x-k*d)
else:
  if (k//syou)%2 == 0:
    if syou%2==0:
      print(x%d)
    else:
      print(min(abs(x%d+d), abs(x%d-d)))
  else:
    if syou%2==0:
      print(min(abs(x%d+d), abs(x%d-d)))
    else:
      print(x%d)



### FIXED CODE ###

x,k,d=map(int,input().split())
x=abs(x)
syou=x//d
if k<=syou:
  print(x-k*d)
else:
  k=k-syou
  x=x%d
  if k%2==0:
    print(x)
  else:
    print(abs(x-d))
import sys


def simulate(i, check_out_bound):
    for t, d in commands:
        if t == s[i]:
            if d == 'L':
                i -= 1
            else:
                i += 1
        if check_out_bound(i):
            return False
    return True


def check(is_left, check_out_bound):
    l, r = 0, n - 1
    while l < r:
        m = (l + r) // 2
        if simulate(m, check_out_bound):
            if is_left:
                r = m
            else:
                l = m
        else:
            if is_left:
                l = m + 1
            else:
                r = m - 1
        # print(is_left, l, r)
    return l


n, q = map(int, input().split())
s = input()
commands = [line.rstrip().split() for line in sys.stdin]

check_out_bound_l = lambda i: i < 0
check_out_bound_r = lambda i: i >= n
if simulate(0, check_out_bound_l):
    bl = 0
else:
    bl = check(True, check_out_bound_l)
if simulate(n - 1, check_out_bound_r):
    br = n - 1
else:
    br = check(False, check_out_bound_r)
print(br - bl + 1)


### FIXED CODE ###

import sys

n, q = map(int, input().split())
s = input()
commands = [line.rstrip().split() for line in sys.stdin]
commands.reverse()

l, r = 0, n - 1
for t, d in commands:
    if s[l] == t and d == 'L':
        l += 1
    elif 0 < l and s[l - 1] == t and d == 'R':
        l -= 1
    if s[r] == t and d == 'R':
        r -= 1
    elif r < n - 1 and s[r + 1] == t and d == 'L':
        r += 1
    if l > r:
        break

print(r - l + 1)
# -*- coding: utf-8 -*-

import numpy as np

N,T=map(int, input().split())
val=[list(map(int, input().split())) for i in range(N)]

#import sys
#input = sys.stdin.readline
#val = list(input()) #abc
#val=np.array(val)
#index=np.argsort(val[:,0])
#A=val[index,0].tolist()
#B=val[index,1].tolist()
val.sort()
A=[v[0] for v in val]
B=[v[1] for v in val]

#temp=np.zeros((T+1,N))
#Ts=T*np.ones(N-1)
#jun=np.arange(1,N)
#for itemp in range(T):
#    i=itemp
#    if i>=A[0]:
#        temp[i,0]=B[0]
#    if i>0:
#        temp[i,:]=np.amax([temp[i,:],temp[i-1,:]],0)
#    for jtemp in range(N-1):
#        j=jtemp+1
#        temp[i,j]=max(temp[i,j],temp[i,j-1])
#    jnext=np.amin([Ts,i+A[1:]],0)
#    jnext=[int(s) for s in jnext]
#    temp[jnext,jun]=np.amax([temp[i,:-1]+B[1:],temp[jnext,jun]],0)

temp=[[0]*N for i in range(T+1)]

for itemp in range(T):
    i=itemp
    if i>=A[0]:
        temp[i][0]=B[0]
    for jtemp in range(N-1):
        j=jtemp+1
        jbfo=temp[i][j-1]
        ijnow=temp[i][j]
        
        if i>0:
            temp[i][j]=max(ijnow,temp[i-1][j])
            
        temp[i][j]=max(ijnow,jbfo)
        if A[j]<T-i:
            temp[i+A[j]][j]=max(jbfo+B[j],temp[i+A[j]][j])
        else:
            temp[T][j]=max(jbfo+B[j],temp[T][j])
print(int(max(temp[-1][:]))) 

### FIXED CODE ###

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

N,T=map(int, input().split())
val=[list(map(int, input().split())) for i in range(N)]

#import sys
#input = sys.stdin.readline
#val = list(input()) #abc
#val=np.array(val)
#index=np.argsort(val[:,0])
#A=val[index,0].tolist()
#B=val[index,1].tolist()
val.sort()
A=[v[0] for v in val]
B=[v[1] for v in val]

#temp=np.zeros((T+1,N))
#Ts=T*np.ones(N-1)
#jun=np.arange(1,N)
#for itemp in range(T):
#    i=itemp
#    if i>=A[0]:
#        temp[i,0]=B[0]
#    if i>0:
#        temp[i,:]=np.amax([temp[i,:],temp[i-1,:]],0)
#    for jtemp in range(N-1):
#        j=jtemp+1
#        temp[i,j]=max(temp[i,j],temp[i,j-1])
#    jnext=np.amin([Ts,i+A[1:]],0)
#    jnext=[int(s) for s in jnext]
#    temp[jnext,jun]=np.amax([temp[i,:-1]+B[1:],temp[jnext,jun]],0)

temp=[[0]*N for i in range(T+1)]

for itemp in range(T):
    i=itemp
    if i>=A[0]:
        temp[i][0]=B[0]
    for jtemp in range(N-1):
        j=jtemp+1
        jbfo=temp[i][j-1]
        ijnow=temp[i][j]
        
        if i>0:
            temp[i][j]=max(ijnow,temp[i-1][j])
            
        temp[i][j]=max(ijnow,jbfo)
        if A[j]<T-i:
            temp[i+A[j]][j]=max(jbfo+B[j],temp[i+A[j]][j])
        else:
            temp[T][j]=max(jbfo+B[j],temp[T][j])
print(int(max(temp[-1][:])))
s = input()
r_cnt = 0
l_cnt = 0
lst = [0 for _ in range(len(s))]
  s += 'R'
for i in range(len(s)):
  if s[i] == 'R' and l_cnt == 0:
    r_cnt += 1
  elif s[i] == 'L' and r_cnt > 0:
    l_cnt += 1
    if r_cnt % 2 == 0:
      lst[i] += r_cnt // 2
      lst[i-1] += r_cnt // 2
    else:
      lst[i] += r_cnt // 2
      lst[i-1] += r_cnt // 2 + 1
    r_cnt = 0
  elif s[i] == 'L' and r_cnt == 0:
    l_cnt += 1
  elif s[i] == 'R' and l_cnt > 0:
    r_cnt += 1
    if l_cnt % 2 == 0:
      lst[i-1] += l_cnt // 2
      lst[i-2] += l_cnt // 2
    else:
      lst[i-1] += l_cnt // 2 + 1
      lst[i-2] += l_cnt // 2
    l_cnt = 0
print(*lst)


### FIXED CODE ###

s = input()
r_cnt = 0
l_cnt = 0
lst = [0 for _ in range(len(s))]
s += 'R'
for i in range(len(s)):
  if s[i] == 'R' and l_cnt == 0:
    r_cnt += 1
  elif s[i] == 'L' and r_cnt > 0:
    l_cnt += 1
    if r_cnt % 2 == 0:
      lst[i] += r_cnt // 2
      lst[i-1] += r_cnt // 2
    else:
      lst[i] += r_cnt // 2
      lst[i-1] += r_cnt // 2 + 1
    r_cnt = 0
    ind = i
  elif s[i] == 'L' and r_cnt == 0:
    l_cnt += 1
  elif s[i] == 'R' and l_cnt > 0:
    r_cnt += 1
    if l_cnt % 2 == 0:
      lst[ind] += l_cnt // 2
      lst[ind-1] += l_cnt // 2
    else:
      lst[ind] += l_cnt // 2 + 1
      lst[ind-1] += l_cnt // 2
    l_cnt = 0
print(*lst)
x = int(input())
a = [input() for i in range(x)]
y = int(input())
b = [input() for h in range(y)]

count_max = 0
for j in a:
  if (a.count(j) - b.count(j)) > count_max:
    a.count(j) - b.count(j) = count_max
print(count_max)

### FIXED CODE ###

x = int(input())
a = [input() for _ in range(x)]
y = int(input())
b = [input() for _ in range(y)]

count_max = 0
for j in a:
  if (a.count(j) - b.count(j)) > count_max:
    count_max = a.count(j) - b.count(j)
print(count_max)
x = input()
print(x*x*x)

### FIXED CODE ###

x = int(input())
print(x*x*x)
# coding: utf-8
# 整数の入力
#a = int(raw_input())
# スペース区切りの整数の入力
import numpy as np

N, MaxTotalWeight = map(int, raw_input().split())

def getWeightValuePair(W,Values,WeightValuePair):
    totalValue = 0
    WeightKeys = WeightValuePair.keys()
    WeightValuePairCopy = WeightValuePair.copy()
    for i in range(len(Values)):
        totalValue += Values[i]
        for totalWeight in WeightKeys:
            if (totalWeight + W * (i+1)) <= MaxTotalWeight:
                if (totalWeight + W * (i+1)) not in WeightValuePair:
                    WeightValuePair[totalWeight + W * (i+1)] = WeightValuePairCopy[totalWeight] +  totalValue
                elif WeightValuePairCopy[totalWeight] +  totalValue > WeightValuePairCopy[totalWeight + W * (i+1)]:
                    WeightValuePair[totalWeight + W * (i+1)] = WeightValuePairCopy[totalWeight] +  totalValue
    return WeightValuePair

Weights = []
WeightsValues = []

for i in xrange(N):
    tempData = map(int, raw_input().split())        
    if i == 0:
        Weights.append(tempData[0])
        Weights.append(tempData[0]+1)
        Weights.append(tempData[0]+2)
        Weights.append(tempData[0]+3)
        WeightsValues.append([tempData[1]])
        WeightsValues.append([])
        WeightsValues.append([])
        WeightsValues.append([])
    else:
        WeightsValues[tempData[0] - Weights[0]].append(tempData[1])

for data in WeightsValues:
    data.sort(reverse=True)
    print data

returnWeightValuePair = {0:0}
for i in range(4):
    returnWeightValuePair = getWeightValuePair(Weights[i],WeightsValues[i],returnWeightValuePair)

print long(max(returnWeightValuePair.values()))
                    

### FIXED CODE ###

N, W = map(int, raw_input().split())
X = [map(int, raw_input().split()) for _ in range(N)]
 
dp = {}
dp[0] = 0
 
for w, v in X:
    d = dp.copy()
    for k in d:
        if k + w > W:
            continue
        if k + w in dp:
            dp[k + w] = max(dp[k + w], d[k] + v)
        else:
            dp[k + w] = d[k] + v
 
print max(dp.values())
n = int(input())

print('ABC' + n)

### FIXED CODE ###

n = str(input())

print('ABC' + n)
n = int(input())
prod = 1
a = []
for i in range(n):
    a.append(int(input()))
sorted(a)
if(a[0]==0):
	print(0)
for i in range(n):
	prod*=a[i]
	if(prod>1e18):
		print(-1)
		return
print(prod)

### FIXED CODE ###

def fun():
	n = int(input())
	A = list(map(int,input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod*=a
		if(prod>1000000000000000000):
			print(-1)
			return
	print(prod)
 
 
 
fun()
N,M = map(int,input().split())
L=[]
R=[]
for i in range(M):
  L_n,R_n = map(int,input().split())
  L.append(L_n)
  R.append(R_n)
Nlist = list(range(L[0],R[0]+1))
  
for i in range(1,M):
  a = L[i]
  b = R[i]
  if Nlist[0]<a or Nlist[-1]>b:
    Nlist = [k for k in Nlist if (k > (a-1)) and (k < (b+1))]
print(len(Nlist))
  

### FIXED CODE ###

N,M = map(int,input().split())
L=[]
R=[]
Nlist = list(range(1,N+1))
for i in range(M):
  L_n,R_n = map(int,input().split())
  L.append(L_n)
  R.append(R_n)

Lmax=max(L)
Rmin=min(R)
if Rmin < Lmax:
  print(0)
else:
  print(Rmin-Lmax+1)
A,V = map(int,input().split())
B,W = map(int,input().split())
N = int(input())
if W > V:
  print('No')
else:
  if abs(A-B) <= N*(V-W):
    print('Yes')
  else:
    print('No)

### FIXED CODE ###

A,V = map(int,input().split())
B,W = map(int,input().split())
N = int(input())
if W > V:
  print('NO')
else:
  if abs(A-B) <= N*(V-W):
    print('YES')
  else:
    print('NO')
import math
a, b, x = map(int, input().split())
h = x / (a * a)
if x < a*a*b / 2:
    print(90-math.degrees(math.atan(2*x/(a*b*b))))
else:
    print(90-math.degrees(math.atan(a/(2*(b-x/(a*a))))))




### FIXED CODE ###

import math
a, b, x = map(int, input().split())
h = x / (a * a)
if x < a*a*b / 2:
    print(90-math.degrees(math.atan(2*x/(a*b*b))))
else:
    print(math.degrees(math.atan((2*(b-x/(a*a)))/a)))
# import math
N = int(input())
# count = 0
# flag = False
# # n = int(math.sqrt(N))
# n = 10000

# for i in range(1, N + 1):
    
#     for j in range(1, n):
#         for l in range(1, n):
#             for r in range(1, n):
#                 if j + l + r > N // 2:
#                     continue
#                 if j ** 2 + l ** 2 + r ** 2 + j * l + j * r + l * r == i:
#                     if j == l == r:
#                         flag = True
#                         count = 1
#                         break
#                     else:
#                         flag = True
#                         count = 3
#                         break
#             if flag:
#                 break
#         if flag:
#             break            
#     print(count)
#     count = 0
#     flag = False
ans = [0] * 10000
for j in range(1, n):
    for l in range(1, n):
        for r in range(1, n):
            value = j * j  + l * l + r * r + j * l + j * r + l * r
            if value < 10000:
                ans[value] += 1

for i in range(N):
    print(ans[i + 1])

### FIXED CODE ###

# # import math
N = int(input())
# # count = 0
# # flag = False
# # # n = int(math.sqrt(N))
n = 105

# # for i in range(1, N + 1):
    
# #     for j in range(1, n):
# #         for l in range(1, n):
# #             for r in range(1, n):
# #                 if j + l + r > N // 2:
# #                     continue
# #                 if j ** 2 + l ** 2 + r ** 2 + j * l + j * r + l * r == i:
# #                     if j == l == r:
# #                         flag = True
# #                         count = 1
# #                         break
# #                     else:
# #                         flag = True
# #                         count = 3
# #                         break
# #             if flag:
# #                 break
# #         if flag:
# #             break            
# #     print(count)
# #     count = 0
# #     flag = False
ans = [0] * 10050
for j in range(1, n):
    for l in range(1, n):
        for r in range(1, n):
            value = j * j  + l * l + r * r + j * l + j * r + l * r
            if value < 10050:
                ans[value] += 1

for i in range(N):
    print(ans[i + 1])
# n = int(input())
# ans = [0 for _ in range(10050)]
# for i in range(1,105):
#     for j in range(1,105):
#         for k in range(1,105):
#             v = i*i+j*j+k*k+i*j+j*k+k*i;
#             if v<10050:
#                 ans[v]+=1   
# for i in range(n):
#     print(ans[i+1])
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return (a * b) // gcd(a, b)

n, m = map(int, input().split())
s = input()
t = input()
l = lcm(n, m)
ans = [""] * l
for i in range(n):
    ans[i * l // n] = s[i]
for i in range(m):
    if ans[i * l // m] and ans[i * l // m] != t[i]:
        print(-1)
        exit()
print(l)

### FIXED CODE ###

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

def lcm(a, b):
    return (a * b) // gcd(a, b)

n, m = map(int, input().split())
s = input()
t = input()
L = lcm(n, m)
l = lcm(L // n, L // m)
for i in range(0, L, l):
    if s[i // (L // n)] != t[i // (L // m)]:
        print(-1)
        exit()
print(L)
a,b=input().split()
a=int(a)
b=int(b)
if a>=10:
  print(b)
else:
  print(int(b-100*(10-a))

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int(b)
if a>=10:
  print(b)
if a<10:
  print(b+(100*(10-a)))
def valid(i,j):
    if i>=0 and i<h and j>=0 and j<w:
        return 1
    return 0
def paths(i,j):

    if valid(i,j)==0 or  a[i][0][j]=='#':
        return 0
    if i==h-1 and j==w-1:
        return 1

    if dp[i][j]==-1:
           dp[i][j]=(paths(i+1,j)%m+paths(i,j+1)%m)%m
           return dp[i][j]
    else:
            return dp[i][j]



h,w=map(int,input().split())
a=[[]for _ in range(h)]
m=1000000007
for i in range(h):
   a[i].extend(input().split())
dp=[[-1 for _ in range(w+1)]for _ in range(h+1)]
print(paths(0,0))


### FIXED CODE ###

import sys
sys.setrecursionlimit(20000)

def paths(i, j):

    if i == h - 1 and j == w - 1:
        return 1
    if a[i][0][j] == '#':
        return 0
    if i < h - 1 and j < w - 1:
        if dp[i][j] == -1:
            dp[i][j] = paths(i + 1, j) + paths(i, j + 1)
            return dp[i][j]
        else:
            return dp[i][j]
    elif i == h - 1 and j < w - 1:
        if dp[i][j] == -1:
            dp[i][j] = paths(i, j + 1)
            return dp[i][j]
        else:
            return dp[i][j]
    elif i < h - 1 and j == w - 1:
        if dp[i][j] == -1:
            dp[i][j] = paths(i + 1, j)
            return dp[i][j]
        else:
            return dp[i][j]


h, w = map(int, input().split())
a = [[] for _ in range(h)]
m = 1000000007
for i in range(h):
    a[i].append(input())
dp = [[-1 for _ in range(1000)] for _ in range(1000)]
print(paths(0, 0) % m)
S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0 :
        a = False 
        break
    else:
        if S[i/2] != 'h' or S[i/2 +1] != 'i':
            a = False
            break

if a == True: 
    print('Yes')
else : 
    print('No')
        
        

### FIXED CODE ###

S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0:
        a = False 
        break
    else:
        if i %2==0 and (S[i] != 'h' or S[i+1] != 'i'):
            a = False

if a: 
    print('Yes')
else: 
    print('No')
n,k,x,y=map(int,input().split())

if n > k:
  print(int(k*10000+(n-k)*9000))
else:  
  print(int(n*10000)

### FIXED CODE ###

n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n<=k:
    sum=n*x
else:
    sum=k*x+(n-k)*y
print(sum)
#!/usr/bin/env python
# -*- coding: utf-8 -*-

var = raw_input().split(" ")
rect = int(var[0]) * int(var[1])
length = int(var[0]) * 2 + int(var[1]) * 2

print rect + " " + length

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

var = raw_input().split()
rect = int(var[0]) * int(var[1])
length = int(var[0]) * 2 + int(var[1]) * 2

print str(rect) + " " + str(length)
import sys
N=input()

print(pow(N,3))

### FIXED CODE ###

import sys
N=int(input())

print(pow(N,3))
import pandas
import math
import numpy
import collections

x = input()
TF =  x.isupper() and x.isalpha()
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    
    if(list == [2,2]):
        print("Yes")

elif(TF==False):
    print("No")
        

### FIXED CODE ###

import collections

x = input()
TF =  x.isupper() and x.isalpha()
flg  = 0
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    if(list == [2,2]):
        print("Yes")
        flg = 1
if(flg == 0):
    print("No")
import math
N, X, T = map(int(input().split()))

print(T * math.ceil(N / X))


### FIXED CODE ###

import math
N, X, T = map(int, input().split())

print(T * math.ceil(N / X))
N = input()

a = 0  # not carried
b = 0  # carried
t = int(N[-1])
a, b = a + t, a + (10 - t)

for i in range(1, len(N))
    t = int(N[-i])
    a, b = min(a + t, b + (t + 1)), min(a + (10 - t), b + (10 - (t + 1)))
print(min(a, b + 1))


### FIXED CODE ###

N = input()

N = '0' + N
result = 0
carry = 0
for i in range(len(N) - 1, 0, -1):
    c = int(N[i]) + carry
    n = int(N[i - 1])
    if c < 5 or (c == 5 and n < 5):
        result += c
        carry = 0
    else:
        result += 10 - c
        carry = 1
result += carry
print(result)
from math import factorial

n,k = map(int,input().split())
mod = 10**9+7

def cmb(n,r):
    return factorial(n) / (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if i > n-k+1:
        print(0)
    else:
        x = cmb(k-1,k-i) % mod
        y = cmb(n-k+1,n-k-i+1)
        print(int(x*y) % mod)


### FIXED CODE ###

from math import factorial

n,k = map(int,input().split())
mod = 10**9+7

def cmb(n,r):
    return factorial(n) // (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if n-k+1 < i or k-1 < i-1:
        print(0)
    else:
        x = cmb(k-1,i-1) % mod
        y = cmb(n-k+1,i) % mod
        ans = (x*y) % mod
        print(int(ans))
in = input().split(' ')

W = int(in[0])
H = int(in[1])
x = int(in[2])
y = int(in[3])
r = int(in[4])

if x - r >= 0 and y - r >= 0 and x + r <= W and y + r <= H:
    print('Yes')
else:
   print('No')

### FIXED CODE ###

import sys

(W, H, x, y, r) = [int(i) for i in sys.stdin.readline().split(' ')]

if x - r >= 0 and x + r <= W and y - r >= 0 and y + r <= H:
    print("Yes")
else:
    print("No")
from collections import Counter
import sys

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


M = int(input())
T = list(map(int, input().split()))
T = sorted(T)
T_counter = Counter(T)


#一つずつずらしていく、Tのkeyとvalueを取り出す
D_keylist = (list(D_counter.items()))

#一つずつずらしていく、Tのkeyとvalueを取り出す
T_keylist = (list(T_counter.keys()))
T_Valuelist = (list(T_counter.values()))

if N < M:
    print("NO")
    sys.exit()




 
ans = 0
T_index = 0
for i in D_keylist:
    D_key = i[0]
    D_value = i[1]

    T_key = T_keylist[T_index]
    T_value = T_Valuelist[T_index]


    if D_key == T_key and (D_value >= T_value):
        T_index = T_index + 1
        ans = ans + 1
    else:
        pass


if len(T_keylist) == ans:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

from collections import Counter
import sys

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


M = int(input())
T = list(map(int, input().split()))
T = sorted(T)
T_counter = Counter(T)



D_keylist = (list(D_counter.items()))

T_keylist = (list(T_counter.keys()))
T_Valuelist = (list(T_counter.values()))


ans = 0
T_index = 0

for i in D_keylist:
    D_key = i[0] # N個の問題案の中のi個めの問題案の番号
    D_value = i[1] # N個の問題案の中のi個めの問題案の難易度

    T_key = T_keylist[T_index] # M個の問題案の中のi個めの問題案の番号
    T_value = T_Valuelist[T_index] # M個の問題案の中のi個めの問題案の番号


    if D_key == T_key and (D_value >= T_value): #もしNとMの番号問題が一致しており、なおかつN個の問題の方が難易度が多かったら加算
        T_index = T_index + 1 #もし一致していたら、Mの問題番号を横にひとつずらす
        ans = ans + 1 #加算

        if T_index == M:
            break
    else:
        pass


if len(T_keylist) == ans: #M個の問題を作る事ができればYES,無理ならNO
    print("YES")
else:
    print("NO")
N=int(input())
lst=[0]
mod=10**9+7

for i in range(N):
  a=int(input())
  if lst[-1]==a:#直前と同じ色はlstに入れない（圧縮）
    continue　
  else:
    lst.append(a)
#今lstのindexと石の個数は等しい
    
length=len(lst)

#全色のリストL、初期値０にしておく
#DPをDP[0]を１に、残りlength-1個を０にしたリストとする
L=[0]*(2*10**5+1)
DP=[0]*(length-1)
DP.insert(0,1)
for i in range(1,length):
  if L[lst[i]]==0:#色がまだ出ていないとき
    DP[i]=DP[i-1]%mod
    L[lst[i]]=i#色のリストLに今のindexを記録
  else:#同じ色が出ているとき
    j=L[lst[i]]#直前の色のindexはj
    DP[i]=(DP[i-1]+DP[j])%mod
    L[lst[i]]=i#色のリストLに今のindexを記録
print(DP[-1])


### FIXED CODE ###

N=int(input())
lst=[0]
mod=10**9+7
for i in range(N):
  a=int(input())
  if lst[-1]==a:
    continue
  else:
    lst.append(a)
length=len(lst)
L=[0]*(2*10**5+1);DP=[0]*(length-1)
DP.insert(0,1)
for i in range(1,length):
  if L[lst[i]]==0:
    DP[i]=DP[i-1]%mod
    L[lst[i]]=i
  else:
    j=L[lst[i]]
    DP[i]=(DP[i-1]+DP[j])%mod
    L[lst[i]]=i
print(DP[-1])
N,M,X,Y = map(int,input().split())
Lx = list(map(int,input().split()))
Ly = list(map(int,input().split()))
count = 0
for i in range(X;Y):
    if max(Lx) < i <= min(Ly):
        count += 1
if count > 0:
    print("No War")
else:
    print("War")


### FIXED CODE ###

n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(max(x)+1,min(y)+1):
    if X < i <= Y:
        print("No War")
        exit()
print("War")
n = int(input())
a = [list(map(int,input().split())) for _ in range(n)]

total = [0]*n

i = 0
count = 0
day = 0
while count < (n*(n-1))//2:
    while total[i] < n-1:
        game = [0] * n
        flag = False
        for j in range(i,n):
            if total[j] == n-1 or game[j] == 0:
                continue
            tmp = a[j][total[j]]
            if game[tmp-1] == 0 and a[tmp-1][total[tmp-1]] == j+1:
                total[j] += 1
                total[tmp-1] += 1
                game[j] += 1
                game[tmp-1] += 1
                count += 1
                flag = True
        if flag == False:
            break
        day += 1
    if flag == False:
        break
    i += 1

if flag == False:
    print(-1)
else:
    print(day)

### FIXED CODE ###

s = input()
t = input()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)
S = input()
 T = input()
count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1
    
 print(count)

### FIXED CODE ###

S = input()
T = input()
count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1
    
print(count)