peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from itertools import accumulate
import bisect
n = int(input())
A = [n for n in range(1,5*10**3)]
B = list(accumulate(A))
i = bisect.bisect_right(B, n)
if B[i-1] == n:
    for j in range(i):
        print(A[j])
else:
    k = B[i] - n
    for j in range(i+1):
        if A[j] == k:
            continue
        print(A[j])
# Judge status: Wrong Answer
# 問題文の意味はわからんけど（ちょうど1回、ちょうど2回割り切れる？？？？は？？？？？？？？）サンプルを適当に読む
d, n = map(int, input().split())
if d == 0:
    if n == 100:
        print(101)
    else:
        print(n)
elif d == 1:
    print(n * 100)
else:
    print(n * 10000)
# Judge status: Accepted
n = int(input())
a = []
b = []
for i in range(n):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)
ans = 0
c = a[::-1]
d = b[::-1]
for i in range(n):
    ans += (d[i] - (c[i]+ans)%d[i]) % d[i]
print(ans)
# Judge status: Wrong Answer
s=int(input())

def c(a,p):
    x=1
    for y in range(p+1,a+1):
        x*=y
    for y in range(2,a-p+1):
        x//=y
    return x
    

mod=10**9+7
ss=s//3
icnt=0
for sss in range(ss):
    r=s-3*sss
    icnt+=c(ss-1+r,r)

print(icnt)
# Judge status: Wrong Answer
n = int(input())

print(n * (n +1) / 2)
# Judge status: Wrong Answer
s = input()
c = set()
for i in range(len(s)):
  c.add(s[i])
c = list(c)
c.sort()
abc = ['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']
for e in abc:
  if e not in c:
    print(e)
    break
if e == 'z':
  print('None')
# Judge status: Accepted
s=input()
t=input()

if t[:-1]==s:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
bricks = map(int, input().split())

ans = 0
cur = 1
for brick in bricks:
    if brick != cur:
        ans += 1
    else:
        cur += 1

if cur == 1:
    ans = -1

print(ans)
# Judge status: Accepted
# solution

from bisect import bisect_left
from operator import itemgetter

nim, mike = map(int, input().split())
array = list(map(int, input().split()))
array1 = []
array2 = []
for _ in range(mike):
    b, c = map(int, input().split())
    array2.append((b, c))

array2 = sorted(array2, key=itemgetter(1), reverse=True)

for b, c in array2:
    array1.extend([c] * b)
    if len(array1) >= nim:
        break

Y = array + array1
Y.sort(reverse=True)
answer = sum(Y[:nim])
print(answer)
# Judge status: Accepted
S = input()

a = ''
for i in range(len(S)//2):
    a += '0'
    a += '1'
if len(S)/2 % 1 != 0:
    a += '0'
b = ''
for i in range(len(S)//2):
    b += '1'
    b += '0'
if len(S)/2 % 1 != 0:
    b += '1'

count_a = 0
for i in range(len(S)):
    if S[i] != a[i]:
        count_a += 1

count_b = 0
for i in range(len(S)):
    if S[i] != b[i]:
        count_b += 1

print(min(count_a, count_b))
# Judge status: Wrong Answer
H, N = map(int, input().split())
Attack_Magic = []
max_a = 0
for i in range(N):
    a, b = map(int, input().split())
    Attack_Magic.append((a, b))
    max_a = max(max_a, a)

Point = [1000000] * (H + max_a + 10)
Point[0] = 0
for i in range(H):
    for j, k in Attack_Magic:
        next = i + j
        cost = Point[i] + k
        Point[next] = min(Point[next], cost)


print(min(Point[H:]))
# Judge status: Accepted
s,k,t=input(),int(input()),""
for q in s:
 if(p:=(123-ord(q))%26)<=k:t+="a";k-=p
 else:t+=q
print(t[:-1]+chr((ord(t[-1])-97+k)%26+97))
# Judge status: Wrong Answer
import math
L, R = map(int, input().split( ))
mod = 2019
#(i*j mod) = (i mod)*(j mod)
m = 2018
s, t = L%2019, R%2019
d = (R - L)//2019
if d >= 1:
  print(0)
  exit()
if t < s:
  print(0)
else:
  print(s*(s+1))
# Judge status: Accepted
n, m = map(int, input().split())

if n * 2 <= m:
    m -= n * 2
    print(n + m // 4)
else:
    print(m // 2)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
A.insert(0,0)
B=[]

for i in range(len(A)):
    cnt=0
    for j in range(len(A)):
        if A[i]-A[j]==-1:
            cnt+=1
            continue
    B.append(cnt)

print(B)
# Judge status: Accepted
Acase = input()
if(Acase.isupper()):
    print("A")
else:
    print("a")
# Judge status: Accepted
N, M, X = map(int, input().split())
lis = []

for i in range(N):
    CA = list(map(int, input().split()))
    lis.append(CA)

ans = 1e9
for i in range(2 ** N):
    check = [0 for i in range(M + 1)]
    for j in range(N):
        if i >> j & 1:
            for k in range(M + 1):
                check[k] += lis[j][k]
        if min(check[1:]) >= X:
            ans = min(ans, check[0])
if ans == 1e9:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
n,m = map(int, raw_input().split(' '))
def intersection(A,B):
	a,b  = max(A[0],B[0]), min(A[1],B[1])
	return [a,b] if a <= b else []

r = [1,n]
for _ in range(m):
	a,b = map(int, raw_input().split(' '))
	keys = intersection(r, [a,b])
	if len(keys) == 0: break
print (keys[1] - keys[0] + 1) if keys else 0
# Judge status: Wrong Answer
S=input().split()
print(S.count("1"))
# Judge status: Accepted
import heapq
n,m = map(int,input().split())
a = list(map(lambda x: int(x)*(-1),input().split()))
heapq.heapify(a)
#print(a)

for _ in range(m):
 tmp_min = heapq.heappop(a)
 heapq.heappush(a,(-1)*(-tmp_min//2))

print(-sum(a))
# Judge status: Wrong Answer
N, M = map(int, input().split())
c = []
for _ in range(M):
    a, b= map(int, input().split())
    c.append(a)
    c.append(b)
import numpy as np
C = np.zeros((N,1),dtype = 'int')
for i in range(len(C)):
    C[i,0] = c.count(i+1)
print(C)
# Judge status: Accepted
n = int(input())
A = tuple(map(int, input().split()))
c4 = 0
c2 = 0
cn = 0
for a in A:
    if a%4==0:
        c4 += 1
    elif a%2==0:
        c2 += 1
    else:
        cn += 1

if c2 == 0 or c2 == 1:
    if cn+c2 <= c4 + 1:
        print('Yes')
    else:
        print('No')
else:
    if cn <= c4:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a + b >= a + a - 1 and a + b >= b + b - 1:
    print(a+b)
elif a + a - 1 >= a + b and a + a - 1 >= b + b - 1:
    print(a + a - 1)
elif b + b - 1> a + b and b + b - 1 >= a + a - 1:
    print(a + b - 1)
# Judge status: Accepted
n, m = map(int, input().split())
tmp = [10]*n

for _ in range(m):
    s,c = map(int, input().split())
    if tmp[s-1] == 10 or tmp[s-1]==c:
        tmp[s-1] = c
    else:
        print('-1')
        exit()

for i in range(n):
    if tmp[i] == 10:
        if i == 0 and n != 1:
            tmp[i] = 1
        else:
            tmp[i] = 0

ans = ''.join(map(str,tmp))

if n != 1 and ans[0] == '0':
    print('-1')
else:
    print(ans)
# Judge status: Wrong Answer
s = input()
if len([i for i in range(len(s)-1) if s[i]==s[i+1]]) == len(s)-1:
    print('Good')
else:
    print('Bad')
# Judge status: Accepted
import math
a,b,x = map(int,input().split())
if x <= a*a*b/2:
    print(90-math.degrees(math.atan2(2*x/(a*b),b)))
elif x > a*a*b/2:
    print(math.degrees(math.atan2(2*b-(2*x/(a**2)),a)))
# Judge status: Wrong Answer
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def test(x, y):
    for index in range(2, y + 1):
        if (x * index % y != 0):
            return x * index
    return -1
print(test(x,y))
# Judge status: Accepted
K ,A, B = map(int,input().split())

if B - A <= 2 or K <= A: #交換しても増やせないorお金をビスケットに交換できない
    ans = K + 1
else:
    n = K - (A + 1)
    n_loop =  n // 2
    n_tataku = n % 2
    ans = B + n_loop * (B-A) + n_tataku
print(ans)
# Judge status: Accepted
H, A = map(int,input().split())

if H % A == 0:
    print(H // A)
else:
    print((H // A) + 1)
# Judge status: Wrong Answer
# -*- coding: <encoding name> -*-
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    S = input()
    T = input()
    Tl = T[:-1]
    if Tl == S:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
	main()
# Judge status: Accepted
n,t = map(int,input().split())
c = [list(map(int,input().split())) for i in range(n)]
p = []

for i in range(n):
    if c[i][1] <= t:
        p.append(c[i][0])

if len(p) == 0:
    print('TLE')
else:
    p.sort()
    print(p[0])
# Judge status: Wrong Answer
X = int(input())


if (400 <= X) and (X < 599):
    print(8)

if (600 <= X) and (X < 799):
    print(7)

if (800 <= X) and (X < 999):
    print(6)

if (1000 <= X) and (X < 1199):
    print(5)

if (1200 <= X) and (X < 1399):
    print(4)

if (1400 <= X) and (X < 1599):
    print(3)

if (1600 <= X) and (X < 1799):
    print(2)

if (1800 <= X) and (X < 1999):
    print(1)
# Judge status: Wrong Answer
N, D = map(int, input().split())

ans = N // (2*D+1)
ans += 1

print(ans)
# Judge status: Wrong Answer
n = int(input())
ans = [0]*(10**4+1)
for x in range(10**2+1):
    for y in range(10**2+1):
        for z in range(10**2+1):
            i = x*x + y*y + z*z + x*y + x*z + y*z
            if i <= 10**4:
                ans[i] += 1
            else:
                break

for i in range(1,n+1):
    print(ans[i])
# Judge status: Wrong Answer
#scc puzzle
n,m=map(int,input().split())
#nがs,mがｃである
if n>2*m:
    print(m)
else:
    #n<=2*m
    print(n+((m-2*n)//4))
# Judge status: Accepted
N = int(input())
S = str(input())

x = 0
m = 0

for i  in range(N):
    if S[i]=="I":
        x += 1
    else:
        x -= 1
    
    if  x>=m:
        m = x

print(m)
# Judge status: Accepted
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, A, B = map(int, readline().split())
ans = 0
for i in range(N + 1):
    s = 0
    t = i
    while t:
        s += t % 10
        t = t // 10

    if A <= s <= B:
        ans += i
print(ans)
# Judge status: Accepted
N,*S = map(int,open(0).read().split())

ans =sum(S)
if ans%10 !=0:
  print(ans)
else:
  S = sorted(S)
  for s in S:
    if s%10 != 0:
      print(ans-s)
      exit()
  print(0)
# Judge status: Wrong Answer
# coding=utf-8

if __name__ == '__main__':
    N, K = map(int, input().split())

    sunuke = [0] * N
    print(sunuke)

    for i in range(K):
        D = int(input())
        li = list(map(int, input().split()))

        for j in range(D):
            sunuke[li[j] - 1] += 1
            #print(sunuke)

    print(sunuke.count(0))
# Judge status: Accepted
A, B, N = map(int, input().split())
x = min(B - 1, N)
print(A * x // B - A * (x // B))
# Judge status: Wrong Answer
a,b=map(int,input().split())
c,d=map(int,input().split())
e=int(input())

if c-a<=e*(b-d):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
#https://atcoder.jp/contests/abc164/tasks/abc164_b
A,B,C,D = map(int,input().split())
Senkou_N,Senkou_Amari = divmod(C,B)
if Senkou_Amari != 0:
    Senkou_N += 1
Koukou_N,Koukou_Amari = divmod(A,D)
if Koukou_Amari != 0:
    Koukou_N += 1

if Senkou_N <= Koukou_N:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
i = 0
while i < len(a)-1:
    cnt = 1
    while a[i] == a[i+1]:
        cnt += 1
        i += 1
        if i == len(a)-1:
            break
    if cnt > a[i]:
        ans += cnt - a[i]
    elif cnt < a[i]:
        ans += cnt
    i += 1
print(ans)
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))

c=[0]*8
maxc=0
for a in A:
    if a>=3200:
        maxc+=1
    else:
        c[a//400]=1
minc = c.count(1)
ans = minc+maxc
print(max(minc,1),ans)
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
x = tx - sx
y = ty - sy
ans = ''
ans += 'R'*x
ans += 'U'*y
ans += 'L'*x
ans += 'D'*-x
ans += 'DR'
ans += 'R'*x
ans += 'U'*y
ans += 'UL'
ans += 'UL'
ans += 'L'*x
ans += 'D'*-x
ans += 'DR'
print(ans)
# Judge status: Wrong Answer
n=input()
k=input()
x=input()
y=input()
if n>k:
  print (k*x) + (n-k)*y
else: 
  print k*n
# Judge status: Accepted
a, b = map(int, input().split())
print(a * b if (a < 10 and b < 10) else -1)
# Judge status: Accepted
K = int(input())
A, B = input().split()


if  int(A) % K ==0 or int(B) % K ==0:
    print("OK")
elif int(A) // K == int(B)//K:
    print("NG")
else:
    print("OK")
# Judge status: Wrong Answer
al = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
ans = 'No'
for i in b:
    for l in range(3):
        if i in al[l]:
            al[l][al[l].index(i)]=0
if al[0][0]+al[1][1]+al[2][2]==0 or al[0][2]+al[1][1]+al[2][0]==0:
    ans = 'Yes'
else:
    for l in al:
        if sum(l)==0:
            ans = 'Yes'
            break
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

ABC = "ABC"
ARC = "ARC"


def solve(S: str):
    if S == ABC:
        return ARC
    else:
        return ABC


def main():
    S = input().strip()
    answer = solve(S)
    print(answer)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import numpy as np

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

if a == 0 or b == 0 or (a <0 and b > 0):
    print("Zero")
elif a > 0:
    print("Positive")
else:
    print("Negative")
# Judge status: Accepted
N,K = list(map(int, input().split()))

ans = 0

for i in range(K,N+2):
    ans += (N-(i-1))*i + 1
    if ans > 10**9 + 7:
        ans = ans % (10**9 + 7)

print(ans)
# Judge status: Accepted
a, b, c, d = list(map(int, input().split()))
def overlap(a, b):
    if max(a[0], b[0]) > min(a[1], b[1]):
        return [0, 0]
    return [max(a[0], b[0]), min(a[1], b[1])]
ans = overlap([a, b], [c, d])
print(ans[1] - ans[0])
# Judge status: Accepted
N,M=map(int,input().split())
h={i for i in range(1,M+1)}
for _ in range(N):
  a=list(map(int,input().split()))
  a=set(a[1:])
  h&=a
print(len(h))
# Judge status: Wrong Answer
a, b, k = map(int, input().split())

ans = set()
k = min(k,b-a)
for i in range(a, a+k):
    ans.add(i)

for i in range(b, b - k, -1):
    ans.add(i)

ans=sorted(list(ans))

for i in (ans):
    print(i)
# Judge status: Accepted
s = input()
t = input()

for i in range(len(s)):
  s1 = s[len(s)-i-1:] + s[:(len(s)-i-1)]
  if (s1 == t):
      print("Yes")
      break
  else:
      if(i == (len(s)-1)):
          print("No")
# Judge status: Wrong Answer
N=int(input())
S=input()
p=10**9+7

from collections import defaultdict
D=defaultdict(int)
num=0
ans=0
dp=[0]*N
dp[0]=2
D[S[0]]+=1
for i in range(1,N):
    s=S[i]
    if D[s]>=1:
        dp[i]=(dp[i-1]+dp[i-1]//(D[s]+1))%p
        #print(D[s])
        D[s]+=1
    else:
        dp[i]=dp[i-1]*2%p
        D[s]+=1
#print(dp)
print(dp[-1]-1)
# Judge status: Accepted
n,m = map(int, input().split())

lmax = 0
rmin = int(1e10)

for _ in range(m):
    l,r = map(int, input().split())
    lmax = max(l, lmax)
    rmin = min(r, rmin)

ans = max(0, rmin - lmax + 1)
print(ans)
# Judge status: Accepted
n = input()

hendred = n[0]
jadgeNumString = n[0]*3
jadgeNum = int(jadgeNumString)

if int(n) <= jadgeNum:
    print(jadgeNum)
else:
    print(jadgeNum + 111)
# Judge status: Wrong Answer
p,q,r=map(int,input().split())
print(p*q/2)
# Judge status: Accepted
n,m=map(int,input().split())
broken=[]
for i in range(m):
  broken.append(int(input()))
b=set(broken)
l=[1]
for j in range(1,n+1):
  if j in b:
    l.append(0)
  elif j==1:
    l.append(1)
  else:
    l.append(l[j-2]+l[j-1])
print(l[n]%(10**9+7))
# Judge status: Accepted
import itertools
n,m,q=map(int, input().split())
S = []
for i in range(q):
    a,b,c,d=map(int, input().split())
    S.append([a,b,c,d])
tl=itertools.combinations_with_replacement(range(1,m+1),n)
ans = 0
for l in tl:
    t = 0
    for a,b,c,d in S:
        if l[b-1]-l[a-1] == c:
            t += d
    ans = max(ans,t)
print(ans)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
S=sum(a[1:])
SS=a[0]
mi=abs(S-SS)
for i in range(1,N-1):
    if mi>=abs(S-SS-2*a[i]):
        S=S-a[i]
        SS=SS+a[i]
        mi=abs(S-SS)
print(mi)
# Judge status: Wrong Answer
D, N = map(int, input().split())
print(int(str(N) + '00' * D) if N != 100 else int(str(N) + '00' * D) + 1)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b,c,d=0,0,0
for i in a:
    if i%4==0:
        b+=1
    elif i%2==0:
        c+=1
    else:
        d+=1
if c==0 and b>=d-1:
    print("Yes")
elif b>=d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m = map(int,input().split())
abl = []
for _ in range(n):
    a,b = map(int,input().split())
    abl.append((a,b))

cdl = []
for _ in range(m):
    c,d = map(int,input().split())
    cdl.append((c,d))

for a,b in abl:
    ans = float("inf")
    log = -1
    for idx, (c,d) in enumerate(cdl):
        tmp = abs(a-c) + abs(b-d)
        if ans > tmp:
            ans = tmp
            log = idx+1
    print(log)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if l[i] % 2 == 0:
        if l[i] % 3 == 0:
            cnt += 1
        elif l[i] % 5 == 0:
            cnt += 1
        else:
            print("DENIED")
            quit()
print("APPROVED")
# Judge status: Accepted
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7
dp=[0]*(n+2)
for i in a:
    dp[i]=-1

dp[0]=1
for i in range(n):
    if dp[i]==-1:continue
    if dp[i+1]!=-1:
        dp[i+1]=(dp[i+1]+dp[i])%mod
    if dp[i+2]!=-1:
        dp[i+2]=(dp[i+2]+dp[i])%mod

print(dp[-2])
#print(dp)
# Judge status: Accepted
N, Y = map(int, input().split())
for x in range(min(Y // 10000 + 1, N + 1)):
  for y in range(min(Y // 5000 + 1, N + 1)):
    r = Y - x * 10000 - y * 5000
    if r >= 0 and r // 1000 == N - x - y: 
      print(x, y, r // 1000)
      exit()
      
print(-1, -1, -1)
# Judge status: Wrong Answer
try:
    n=list(map(int, input().strip().split()))

    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if n[i]!=n[a]:
                z=int(n[a]+n[i])
                lis1.append(str(z))
               
    print(min(lis1))
except:
    print('')
# Judge status: Accepted
import sys
from math import sqrt
from collections import Counter, defaultdict

input = sys.stdin.readline


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    n, k = MI()
    mod = n % k
    if mod > abs(mod - k):
        print(abs(mod - k))
    else:
        print(mod)

    pass


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


def solve():

    N = int(input())

    wlist = [input() for i in range(N)]
    s = set(wlist)

    if len(wlist) != len(s):
        print("No")
        exit()
    else:
        last = wlist[0][-1]
        for i in range(1, N):
            ini = wlist[i][0]
            if last != ini:
                print("No")
                exit()
            last = wlist[i][-1]

    print("Yes")


if __name__ == "__main__":
    solve()
# Judge status: Accepted
S = input()

count = S.count('R')

if count == 0 or count == 1 or count == 3:
    print(count)
else:
    if S == 'RSR':
        print(1)
    else:
        print(2)
# Judge status: Accepted
import heapq

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x*(-1), a))
heapq.heapify(a)

for i in range(m):
    max_item = heapq.heappop(a) * -1
    heapq.heappush(a, (max_item // 2) * -1)

print(sum(a) * -1)
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))

for i in range(n - k):
    if A[i] < A[i + k]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
x,y,a,b,c = map(int, input().split())

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort()
q.sort()
r.sort()

ans = p[-x:]+q[-y:]
ans.sort()

for i in range(min(len(ans), len(r))):
    R = r.pop()
    if ans[i]<=R:
        ans[i]=R
    else:
        break
print(sum(ans))
# Judge status: Accepted
a,b,c = map(int,input().split())

ans = c-(a-b)

if ans >= 0:
    print(ans)
else:
    print(0)
# Judge status: Wrong Answer
N = int(input())
for i in range(N):
  price = int(i * 1.08)
  if(price == N):
    print(i)
    exit()
print(":(")
# Judge status: Accepted
a,b,c = map(int,input().split())


print(len(set([a, b, c])))
# Judge status: Accepted
n = int(input())
s = input()
migi = s.count(".")
hidari = 0
ans = migi
for i in range(n):
    if s[i] == "#":
        hidari += 1
    elif s[i] == ".":
        migi -= 1
    ans = min(ans,hidari+migi)
print(ans)
# Judge status: Wrong Answer
n = int(input())
i = 1
while i ** 2 < n:
    i += 1

print(i ** 2)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

if a[0] != 0: print(-1); exit()

s = [0] * (n+2)
for i in range(n+1)[::-1]:
    s[i] = s[i+1]+a[i]

x = 1
ans = 0
for i in range(n+1):
    ans += x
    x -= a[i]
    if x <= 0 and i != n: print(-1); exit()
    if x == s[i]: continue
    if x*2 > s[i+1]: x = s[i+1]
    else: x *= 2

print(ans)
# Judge status: Accepted
S = input()
K = int(input())

ones = 0
inf = None
for c in S:
    if c=='1':
        ones += 1
    else:
        inf = c
        break

if K <= ones:
    print('1')
else:
    print(inf)
# Judge status: Accepted
n = int(input())
s = input()
t = input()
ans = s+t
for i in range(n):
    if s[i] == t[0]:
        if s[i:] == t[:n-i]:
            ans = s[:i]+t
            break
print(len(ans))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 0
def check_all():
    global a,n
    for i in range(n):
        if a[i]%2!=0:
            return False
    return True
while check_all():
    ans += 1
    for i in range(n):
        a[i] //= 2
print(ans)
# Judge status: Accepted
a = input()

if str.isupper(a) == True:
    print('A')
else:
    print('a')
# Judge status: Accepted
from itertools import *
A,B,C = map(int,input().split())
ans = 10**18
if A%2 == 0 or B%2 == 0 or C%2 == 0:
  ans = 0
else:
  for i,j in combinations([A,B,C],2):
    ans = min(ans,i*j)
print(ans)
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

# In[12]:


import collections


# In[10]:


N = int(input())
s = []
for _ in range(N):
    s.append(input())


# In[30]:


ans = 0
mydict = {}
for i in range(N):
    tmp = "".join(sorted(s[i]))
    if tmp not in mydict:
        mydict[tmp] = 1
    else:
        ans += mydict[tmp]
        mydict[tmp] += 1
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
import math

X,Y=map(int,input().split())

print(1 + math.floor(math.log2(Y/X)))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = dict()

for ai in a:
    if ai not in cnt.keys():
        cnt[ai] = 1
    else:
        cnt[ai] += 1

ans = 0
for k in cnt.keys():
    if cnt[k] > k:
        ans += cnt[k] - k
    elif cnt[k] < k:
        ans += cnt[k]
print(ans)
# Judge status: Accepted
from math import factorial as fac
x,y=map(int,input().split())
a=(2*y-x)/3
b=(2*x-y)/3
mod=10**9+7
if a>=0 and b>=0 and a==int(a) and b==int(b):
  a=int(a)
  b=int(b)
  a1=1
  a2=1  
  n3=10**9+7
  for i in range(a):
    a1*=a+b-i
    a2*=i+1
    a1%=n3
    a2%=n3
  a2=pow(a2,n3-2,n3)
  print((a1*a2)%n3)
else:
  print(0)
# Judge status: Accepted

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

from fractions import gcd

res=a*b/gcd(a,b)
print(int(res))
# Judge status: Accepted
def main():
    N = int(input())
    nums_list = [list(map(int, input().split())) for _ in range(N)]
    nums_list.reverse()
    cnt = 0
    for a, b in nums_list:
        cnt += (b - (a + cnt)) % b
    print(cnt)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
import fractions
MOD=1000000007
n=int(input())
a=list(map(int,input().split()))
x=1
ans=0
for i in a:
  x=x*i//fractions.gcd(x,i)
for i in a:
  ans=ans+x//i
print(ans%MOD,'\n')
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

t = C /B
a = A /D

if t <= a+1 :
    ans = "Yes"
    if A % D == 0 and C % B ==0:
        ans = "Yes"
    elif A % D == 0:
        ans = "No"
    else:
        ans = "Yes"
else:
    ans = "No"
print(ans)