peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
# coding: utf-8
# Your code here!
 
import fractions
 
n, m = map(int, input().split(" "))
numbers = list(set(map(int, input().split(" "))))
 
for i in range(len(numbers)):
    if i == 0:
        gcd = numbers[i]
        lcm = numbers[i]
    else:
        gcd = fractions.gcd(gcd, numbers[i])
        lcm = (lcm * numbers[i]) // fractions.gcd(lcm, numbers[i])
 
if (lcm//gcd) % 2 == 0:
    print(0)
else:
    init_num = lcm // 2
    print((m - init_num) // lcm + 1)
# Judge status: Wrong Answer
x=input()
if x==0:
  print(1)
else:
  print(0)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
import sys
import math

if sum(A) <= N+K:
  print(1)
  sys.exit()

lt = 1
rt = 10**9

def det(x):
  if sum([math.ceil(A[i]/x) for i in range(N)]) <= N+K:
    return True
  else:
    return False
  
while rt - lt > 1:
  ct = (lt + rt) // 2
  if det(ct):
    rt = ct
  else:
    lt = ct
  
  
print(rt)
# Judge status: Accepted
N, A, B = map(int,input().split())
S = input()

a_counter = 0
b_counter = 0

for i in range(N):
  s = S[0]
  if s == "a" and a_counter + b_counter <A+B:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter < B and a_counter + b_counter <A+B:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]
# Judge status: Accepted
import bisect
n=int(input())
l=list(map(int,input().split()))
l=sorted(l)
ans=0
for i in range(n-2):
  for k in range(i+1,n-1):
    ans+=bisect.bisect_left(l,l[i]+l[k])-k-1
print(ans)
# Judge status: Accepted
import fractions
a, b = map(int, input().split())
print(int(a * b / fractions.gcd(a, b)))
# Judge status: Wrong Answer
N = int(input())
A = [int(input())*N+(N-i-1) for i in range(N)]
A.sort()
for i in range(N):
  A[i] = N - A[i] % N - 1
L = [0 for _ in range(N)]
for i in range(N):
  L[A[i]] = i
m = 0
cnt = 1
for i in range(1, N):
  if L[i-1] > L[i]:
    cnt += 1
  else:
    m = max(m, cnt)
    cnt = 1
m = max(cnt, m)
print(m)
# Judge status: Accepted
import fractions
a,b=map(int,input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(a, b))
# Judge status: Accepted
N = int(input())
ans = False
count = 0
D1, D2 = 0, 0
for i in range(N):
    D1, D2 = list(map(int, input().split()))
    if D1 == D2:
        count += 1
        if count >= 3:
            ans = True
    else:
        count = 0

if ans == True:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())
print(max(C-B, 0))
# Judge status: Accepted
s = input()

if "ABC" == s:
    print("ARC")
else:
    print("ABC")
# Judge status: Wrong Answer
n = int(input())
print((n+1)*n/2)
# Judge status: Accepted
n = input()

if n[-1] == '3':
  print('bon')
elif n[-1] in ['0','1','6','8']:
  print('pon')
else:
  print('hon')
# Judge status: Wrong Answer
A,B,C,D = map(int,input().split())

a = []
b = []

for i in range(A, B + 1):
  a.append(i)

for i in range(C, D + 1):
  b.append(i)

a.extend(b)

ans = [x for x in set(a) if a.count(x) > 1]
print(len(ans) - 1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = 0
while len(A)>= 2:
  ans += A[0]-A[1]
  A = A[2:]
if len(A) == 1:
  ans += A[0]
print(ans)
# Judge status: Wrong Answer
a = input()
for i in range(len(a)):
    if a[i] == "A":
        b = i
        break
for j in range(b,len(a)):
    if a[j] == "Z":
        c = j
        break
print(c-b+1)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, m = map(int, input().split())
if n == 1:
    print(m - 2)
    sys.exit(0)
if m == 1:
    print(n - 2)
    sys.exit(0)

print(n * m - (n * 2 + m * 2 - 4))
# Judge status: Accepted
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
an = 0
for i in range(x+1,y+1):
    if max(xi) < i <= min(yi):
        an+=1
    
if an > 0:
    print("No War")
else:
    print("War")
# Judge status: Accepted
s=str(input());t=str(input())
ans=0
for i in range(len(s)):
    if s[i]!=t[i]:
        ans+=1
print(ans)
# Judge status: Accepted
x,y,z=map(int, input().split())
print((x-z)//(y+z))
# Judge status: Accepted
a, b, c = map(int, input().split())
for i in range(a):
    s = i*b+c
    if s % a == 0:
        print('YES')
        exit()
        
print('NO')
# Judge status: Accepted
a,b=map(int,input().split())
print((0 if a < 6 else int(b/2)) if a < 13 else b)
# Judge status: Accepted
x=int(input())
if 400 <= x <= 599:
  print(8)
elif 600 <= x <= 799:
  print(7)
elif 800 <= x <= 999:
  print(6)
elif 1000 <= x <= 1199:
  print(5)
elif 1200 <= x <= 1399:
  print(4)
elif 1400 <= x <= 1599:
  print(3)
elif 1600 <= x <= 1799:
  print(2)
elif 1800 <= x <= 1999:
  print(1)
else:
  none
# Judge status: Accepted
#input
R = int(input())

#output
print(2*R*3.14159265)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if b % a == 0:
    print(round(b/a))
elif round(b/a) > c:
    print(c)
# Judge status: Accepted
from collections import Counter

N = int(input())

strings = [input() for i in range(N)]

string_set = list(map(set,strings))
count_set = list(map(Counter, strings))

common_letter = string_set[0]

for s in string_set:
    common_letter = common_letter & s

common_letter_nums = {}

for l in common_letter:
    common_letter_nums.setdefault(l, [])
    for c in count_set:
        common_letter_nums[l].append(c[l])

output_letter = ''
for k, v in common_letter_nums.items():
    output_letter += k * min(v)

print(''.join(sorted(output_letter)))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

numbers = []

s = A[0]
for i in range(1, N):
    s = s ^ A[i]
for i in range(N):
    numbers.append(s ^ A[i])

print(*numbers)
# Judge status: Accepted
import math
n, d = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = []
sum = 0
ans = 0
for i in range(n):
     for j in range(n):
          if j > i:
               for k in range(d):
                    sum += ((l[i][k] - l[j][k]))**2 
               x.append(math.sqrt(sum))
               sum = 0
for i in range(len(x)):
     if x[i].is_integer() == True:
          ans += 1
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
print(max(a*2-1,2*b-1,a+b))
# Judge status: Wrong Answer
import math
N,M = map(int,input().split())

if abs(N-M) > 2:
    print(0)
    exit()
sum = 1
count = 0
if N == M:
    sum *= N+M
    sum *= int(((N+M)/2))
    N = int((N+M)/2)-1
    M = N
else:
    sum *= max(N,M)

k = math.factorial(min(N,M))
sum *= k**2

print(sum%(10**9+7))
# Judge status: Wrong Answer
def main():
    import sys
    input=sys.stdin.readline
    L,R=map(int,input().split())

    if R-L>=2019:
        print(0)
    else:
        min_number=2019
        for i in range(L,R+1):
            min_number=min(min_number,i%2019)
        if min_number==0:
            print(0)
        else:
            print((L*(L+1))%2019)

if __name__=="__main__":
    main()
# Judge status: Wrong Answer
N,H = map(int,input().split())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
B.append(0)
a = max(A)
B.sort()
ans = 0
while a <= B[-1]:
    b = B.pop()
    H -= b
    ans += 1
last = (H+a-1)//a
ans += last
print(ans)
# Judge status: Accepted
N = int(input())
S = list(map(int,input().split()))

cnt = 0
while True:
  check = sum([n % 2 for n in S])
  if check == 0:
    S = [n/2 for n in S]
    cnt += 1
  else:
    break
    
print(cnt)
# Judge status: Accepted
lst = list(map(int, input().split()))
print('Yes' if len(set(lst)) == 2 else 'No')
# Judge status: Accepted
N, M = map(int,input().split())	
A = list(map(int,input().split()))
sumA = N - sum(A)
if sumA < 0:
  print(-1)
else:
  print(sumA)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
sm=sum(a)
i=0
han=0

while sm/2>han:
  han+=a[i]
  i+=1
nhan=sm-han

print(abs(han-nhan))
# Judge status: Accepted
x, n = map(int, input(). split())
p = []
if n > 0:
  p = list(map(int, input(). split()))
if n == 0:
  print(x)
else:
  if x not in p:
    print(x)
  else:
    d = 1
    while True:
      if x-d not in p:
        print(x-d)
        break
      if x+d not in p:
        print(x+d)
        break
      d += 1
# Judge status: Wrong Answer
n = int(input())
c = []
cou = 1
for i in range(n):
  c.append(input())

set(c)
  
print(len(c))
# Judge status: Accepted
n,k = map(int,input().split())
m=10**9+7
print(((n-k+2)*(n*(n+k+1)+2*k*(1-k)+6)//6)%m)
# Judge status: Accepted
import collections
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

ctr_s = collections.Counter(s)
ctr_t = collections.Counter(t)
ans = 0
for k,v in ctr_s.items():
    if ctr_s[k]:
        ans = max(ans, v - ctr_t[k])
    else:
        ans = max(ans, v)
print(ans)
# Judge status: Accepted
# A - Colorful Subsequence AC (hint)
import collections
N = int(input())
S = input()
MOD = 10**9+7

cnt = collections.Counter(S)

# 文字の選び方
# 1 個選ぶ or 2 選ぶ or 3 個選ぶ or ... cnt 個選ぶ or 選ばない
# (cnt + 1) 通り
ans = 1
for value in cnt.values():
    ans = (ans*(value+1))%MOD
print(ans - 1)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    from itertools import accumulate

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

    B = [0] + A
    B = list(accumulate(B))  # 累積和を格納したリスト作成

    ans=10**18
    for i in range(1, N):
        snuke=B[i]
        araiguma=B[N]-B[i]
        ans=min(ans,abs(snuke-araiguma))
    print(ans)
resolve()
# Judge status: Wrong Answer
N = int(input())
if N == 1:
    print(0)
for i in range(6):
    if 2**i > N:
        print(i-1)
        exit()
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, m = map(int, readline().split())
xy = [list(map(int, readline().split())) for _ in range(m)]
flag = [False] * n
flag[0] = True
cnt = [1] * n
for x, y in xy:
    if flag[x - 1]:
        flag[y - 1] = True
    cnt[x - 1] -= 1
    cnt[y - 1] += 1
    if cnt[x - 1] == 0:
        flag[x - 1] = False
print(flag.count(True))
# Judge status: Accepted
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n = I()
    a = list(IL())
    m = [0]*n
    for rep in a:
        m[rep-1] += 1
    for rep in m:
        print(rep)
    return

if __name__=='__main__':
    Main()
# Judge status: Wrong Answer
A,B = map(str,input().split())
AB = A * int(B)
BA = B * int(A)

if A >= B:
    print(AB)
elif A < B:
    print(BA)
# Judge status: Accepted
h = int(input())

cnt = 0
while True:
    cnt += 1
    if h == 1:
        break
    h = h // 2

result = 0
for i in range(cnt):
    result += 2**i
print(result)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)
# Judge status: Wrong Answer
def dfs(i, j, s):
    if j == 7:
        return s == 'keyence'
    if i >= N:
        return False
    res = False
    for k in range(i+1, N):
        res |= dfs(k, j+1, s+S[k])
    return res

S = input()
N = len(S)
flg = 0
for i in range(N-7+1):
    if S[i] == 'k':
        flg |= dfs(i, 1, 'k')
if flg:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import math


c=input()

if "9" in c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, A, B = [int(x) for x in input().split()]
ans = 0
for i in range(1, N + 1):
    i = str(i)
    total = 0
    for j in i:
        total += int(j)
    if A <= total <= B:
        ans += int(i)
print(ans)
# Judge status: Wrong Answer
from sys import stdin
def main():
  readline = stdin.readline
  N = int(readline())
  L = [list(map(int, readline().split())) for _ in range(N)]
  cnt = 0
  for l in L[::-1]:
    a = l[0] + cnt
    b = l[1]
    if a % b != 0:
      cnt += a % b
  print(cnt)
if __name__ == "__main__":
  main()
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

s = readline()

if s == "ABC":
    print("ARC")
else:
    print("ARC")
# Judge status: Accepted
n,k=map(int,input().split())

x=0
ans=0

for i in range(1,n+1):
    score=i
    p=1/n
    while score<k:
        p*=0.5
        score*=2
    ans+=p
    

print(ans)
# Judge status: Wrong Answer
a = input()
frm = int(a[:2])
lat = int(a[2:])


if frm >= 12 and lat >= 12:
    print('NA')
elif frm <= 12 and lat > 12:
    if 0<frm:
        print('MMYY')
    else:
        print('NA')    
elif frm > 12 and  lat <= 12:
    if lat > 0:
        print('YYMM')
    else:
        print('NA')
elif frm <= 12 and lat==0:
    print('MMYY')
elif frm == 0 and  lat <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')
# Judge status: Wrong Answer
O = input()
E = input()

x = [o+e for o,e in zip(O,E)]
print(''.join(x))
# Judge status: Accepted
from sys import stdin
input = stdin.readline
N = int(input())
S = {}
for n in range(N):
    s = input()
    if S.get(s) == None:
        S[s] = 1
    else:
        S[s] += 1
m = max(S.values())
A = [k for k,v in S.items() if v == m]
A = sorted(A)
for a in A:
    print(a.rstrip('\n'))
# Judge status: Accepted
a,b=map(int,input().split())
if a>=13:
    print(b)
elif 6<=a<=12:
    print(b//2)
elif a<=5:
    print("0")
# Judge status: Accepted
x, y, z = map(int, input().split())
print(z, x, y)
# Judge status: Accepted
s=[int(input()) for _ in range(5)]
k=int(input())
if s[4]-s[0]>k:
    print(":(")
else:
    print("Yay!")
# Judge status: Accepted
N = int(input())
W = list(map(int, input().split()))
print(min([abs(sum(W[:i]) - sum(W[i:])) for i in range(N)]))
# Judge status: Accepted
N=input()
ans=[]
for i in N:
    if i=='B':
        if not ans==[]:
            ans.pop()
    else:
        ans.append(i)
print(''.join(ans))
# Judge status: Accepted
import math

N = int(input())
print(math.factorial(N) % (10**9+7))
# Judge status: Accepted
n = int(input())
s = input()
li = [1]*26
for c in s:
    li[ord(c)-ord('a')] += 1
ans = 1
for i in li:
    ans *= i
ans -= 1
print(ans%(10**9+7))
# Judge status: Wrong Answer
n=int(input())
w=list(map(int,input().split()))
half=sum(w)*0.5
wa=0
num=0
for i in range(n):
  if wa>half:
    break
  wa+=w[i]
  num=i
print(abs(sum(w)-wa*2))
# Judge status: Wrong Answer
N,L=map(int,input().split())

tot=N*L+(N-1)*N/2
ans=[]


for i in range(N):
    ans.append(abs(L+i))

a=ans.index(min(ans))

print(tot-(a+L))
# Judge status: Accepted
S = input()
a = 0
b = 0

for i in range(len(S)):
  if (i + 1) % 2 == 0:
    if S[i] == "0":
      a += 1
    else:
      b += 1
  else:
    if S[i] == "1":
      a += 1
    else:
      b += 1
print(min(a,b))
# Judge status: Accepted
import math 
x = int(input())
# x = 10**15
xi = math.floor(x/5.5)
# print(xi)
for i in range(xi,10000000000000000000000000000):
    # print(6*i - math.floor(i/2))
    if(x <= 6*i-math.floor(i/2)):
        xa = i
        break

print(xa)
# Judge status: Accepted
a = input()
if "RRR" in a:
  print(3)
elif "RR" in a:
  print(2)
elif "R" in a:
  print(1)
else:
  print(0)
# Judge status: Accepted
# coding: utf-8

S = input()

res = 0
now_mojisu = 0
agct = ["A", "C", "G", "T"]

for i in S:
    if i in agct:
        now_mojisu += 1
    else:
        now_mojisu = 0
    res = max(res, now_mojisu)

print(res)
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())

if(k-a-b<=0):
    print(1*a+0*(k-a))
else :
    print(1*a+0*(k-a)-1*(k-a-b))
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))
answer = 100000
while True:
    if n <= k + (k - 1) * (answer - 1):
        answer -= 1
    else:
        break

print(answer + 1)
# Judge status: Accepted
L,R = list(map(int,input().split()))
if R-L+1 >= 2019:
    ans = 0
else:
    ans = 2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            s = (i*j)%2019
            ans = min(s,ans)
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
l = [0]*(M)
for i in range(1,M):
    l[i] = x[i]-x[i-1]
l.sort(reverse=True)
print(sum(l[(N-1):]))
# Judge status: Wrong Answer
a, b, x = map(int, input().split())
nums = [i if i%x == 0 else 0 for i in range(a, b+1)]
print(len(set(nums))-1)
# Judge status: Wrong Answer
n,m=map(int,input().split())
gakusei=[]
for i in range(n):
  gakusei.append(list(map(int,input().split())))
check=[]
for j in range(m):
  check.append(list(map(int,input().split())))
for k in range(0,n):
  minkyori=10*100
  keep=-1
  for l in range(0,m):
    kyori=abs(gakusei[k][0]-check[l][0])+abs(gakusei[k][1]-check[l][1])
    if kyori<minkyori:
      minkyori=kyori
      keep=l
  print(keep+1)
# Judge status: Wrong Answer
import sys
import math

i=list(map(int,input().split()))

a=i[0]
b=i[1]
t=i[2]

ans=t/a*b
print(int(ans))
# Judge status: Wrong Answer
S = input()
ans = ''
t = ''
acgt = 'ACGT'
for s in S:
    if (s in acgt):
        t += s
    else:
        if (len(ans) < len(t)):
            ans = t

if (len(ans) < len(t)):
    ans = t
print(ans)
# Judge status: Accepted
W, H, N = map(int, input().split())
xya = [list(map(int, input().split())) for i in range(N)]
X=Y=0
for i in range(N):
    if xya[i][2] == 1:
        X = max(X,xya[i][0])
    if xya[i][2] == 2:
        W = min(W,xya[i][0])
    if xya[i][2] == 3:
        Y = max(Y,xya[i][1])
    if xya[i][2] == 4:
        H = min(H,xya[i][1])
print(max(W-X,0)*max(H-Y,0))
# Judge status: Wrong Answer
H = int(input())

ans = 1
for i in range(1, 40):
    if int(H/2) >= 1:
        ans += 2**i
        H = int(H/2)
    else:
        ans += 2**(i-1)
        break

print(ans)
# Judge status: Wrong Answer
def TableTennisTraining():

    num = list(map(int,input().split()))

    if (num[1] - num[2]) % 2 == 0:
        
        print(abs(num[1] - num[2])/2)
    
    else:
        
        right = max([num[0] - num[1], num[0] - num[2]])
        
        left = max([num[1] - 1, num[2] - 1])
        
        print(min([right, left]))

if __name__ == '__main__':
    TableTennisTraining()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
mae = -1
for i in range(n):
    k = a[i]
    ans += b[k -1]
    if mae == k -1:
       ans += c[k -2]
    mae = k
print(ans)
# Judge status: Accepted
def is_even_str(s):
    l = len(s)
    if l % 2 != 0:
        return False
    return s[:l // 2] == s[l // 2:]


S = input()[:-2]
while not is_even_str(S):
    S = S[:-2]
print(len(S))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, M, K = map(int, input().split())
for i in range(N + 1):
  for j in range(M + 1):
    if i * M + j * N - i * j * 2 == K:
      print("Yes")
      exit(0)
print("No")
# Judge status: Accepted
X,N = map(int,input().split())
 
p = list(map(int,input().split()))
 
import sys
for i in range(102):
 
    if X-i not in p:
        print (X-i)
        sys.exit()
    elif X+i not in p:
        print (X+i)
        sys.exit()
# Judge status: Accepted
n=int(input())
ar=list(map(int,input().split()))
ar.sort(reverse=True)
ans=0
for i in range(1,n):
    ans+=ar[i//2]
print(ans)
# Judge status: Accepted
k = int(input())
if k%2 == 0:
    ans = -1
else:
    x = 0
    ans = -1
    for i in range(10**6+1):
        x += 7*pow(10, i, k)
        x %= k
        if x%k == 0:
            ans = i+1
            break
print(ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))
# Judge status: Wrong Answer
N, X, Y = map(int, input().split())
X -= 1
Y -= 1

R = [0 for _ in range(N - 1)]

for i in range(N - 1):
    for j in range(i + 1, N):
        res = j - i
        if i <= X <= j <= Y:
            res = min(res, Y - j + X - i + 1)
        if X <= i <= Y <= j:
            res = min(res, i - X + j - Y + 1)
        if i <= X and Y <= j:
            res = min(res, j - Y + X - i + 1)
        R[res - 1] += 1

for r in R:
    print(r)
# Judge status: Accepted
N,Q = list(map(int,input().split()))
S = input()
L = [list(map(int,input().split())) for _ in range(Q)]

B= [0]
for i in range(N-1):
    if S[i] == 'A' and S[i+1] == "C":
        B.append(1)
    else:
        B.append(0)

from itertools import accumulate 
B = list(accumulate(B))

for i in range(Q):
    print(B[L[i][1]-1] - B[L[i][0]-1 ])
# Judge status: Wrong Answer
n = int(input())
l = []
ans = 'Yes'
ps = 'a'
for i in range(n):
  s = input()
  if s in l:
    ans = 'No'
  l.append(s)
  if i != 0 and ps[-1] != s[0]:
    ans = 'No'
  pas = s

print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
sumf = sum(a[:k])
for i in range(1,n-k+1):
    sumn = sumf - a[i-1] + a[i+k-1]
    print("Yes" if sumn>sumf else "No")
    sumf = sumn
# Judge status: Wrong Answer
S = input()
List = ["Sunny", "Cloudy", "Rainy"]
print(List.index(S)+1)
# Judge status: Accepted
# D - Banned K
from collections import Counter


def main():
    N, *A = map(int, open(0).read().split())
    counter = Counter(A)
    total = 0
    dif = {}
    for k, v in counter.items():
        total += v * (v - 1) // 2
        dif[k] = v - 1
    ans = [total - dif[a] for a in A]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    A = sorted(A)
    if len(set(A)) == len(A):
        for i in range(1, N):
            count = 0
            for j in range(i):
                if A[i] % A[j] == 0:
                    count += 1
            if count == 0:
                ans += 1
        print(ans)
    else:
        print("0")
resolve()
# Judge status: Accepted
A,B,K = map(int,input().split())
Min = min(A,B)
c = []
for i in range(1,Min+1):
  if A % i == 0 and B % i == 0:
    c.append(i)
n = len(c)
print(c[n-K])
# Judge status: Wrong Answer
S=input()
T=input()
T="".join(sorted(T, reverse=True))

if S<T:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import collections

s = list(input())

num_1 = s.count("1")
num_0 = s.count("0")

print(min(num_0,num_1)*2)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

ans = 0
for v in range(a, b+1):
    v = str(v)
    if v == ''.join(reversed(v)):
        ans += 1
print(ans)
# Judge status: Accepted
import itertools

n = int(input())
seed = [i for i in range(1, n+1)]
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

alls = list(itertools.permutations(seed))

print(abs(alls.index(p) - alls.index(q)))
# Judge status: Wrong Answer
times = [input() for _ in range(5)]

res = 0
for i in times:
  res += (int(i)//10)*10+10
  
time = []
for j in times:
  time.append((int(j[-1]) if j[-1] != "0" else 10))
  
print(res - 10 + min(time))
# Judge status: Accepted
n = int(input())
S = input()
T = S
for i in range(100):
    for j in range(n):
        if j+1 < len(S) and S[j] == '(' and S[j+1] == ')':
            S = S[:j]+S[j+2:]
a = S.count('(')
b = S.count(')')
print('('*b+T+')'*a)
# Judge status: Wrong Answer
import random
print(int(random.random()*2))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

li = [0] * (n+1)
tmp = 0

for i in range(n):
    li[a[i]] += 1
    
for i in range(n):
    tmp += sum(int(i) for i in range(li[i]))
    
for i in range(n):
    ans = tmp - li[a[i]] + 1
    print(ans)
# Judge status: Accepted
N, R = map(int, input().split())

if N<= 10:
	print(R+100*(10-N))
else:
	print(R)
# Judge status: Wrong Answer
N = int(input())
L = [0]*(N+1)
L[0] = 2
L[1] = 1
if N<=2:
    print(L[N-1])
    exit()
for i in range(2,N+1):
    L[i] = L[i-1]+L[i-2]
print(L[N])