Harryxun/stf_run huggingface dataset:
r=input().split()
A=int(r[0])
B=int(r[1])
C=int(r[2])
K=int(r[3])
d_a=[1]*A
d_b=[0]*B
d_c=[-1]*C
d=d_a+d_b+d_c
ans=0
for i in range(K):
    ans+=d[i]
print(ans)

### FIXED CODE ###

r=input().split()
A=int(r[0])
B=int(r[1])
C=int(r[2])
K=int(r[3])
if K<=A:
    print(K)
elif K<=A+B:
    print(A)
else:
    print(2*A-K+B)
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
def gcd(a,b):
  c = a%b
  if c == 0:
    return b
  else:
    return gcd(b,c)
c = 0
for i in a[1:]:
  c_ = gcd(i,a[0])
  if c_ == 1:
    c = 1
    break
  else:
    if c_ < c or c == 0:
      c = c_
print(c)


### FIXED CODE ###

a,b = list(map(int,input().split()))
if b%a == 0:
  print(a+b)
else:
  print(b-a)
H, W = list(map(int, input().split()))
grid = [[c for c in input()] for r in range(H)]
paths = [[-1 for r in range(W)] for c in range(H)]
paths[0][0] = 1

def calc(r, c):
    if not ((0 <= r <= H-1) and (0 <= c <= W-1)): return 0
    if paths[r][c] == -1:
        if grid[r][c] == "#":
            paths[r][c] = 0
        else:
            paths[r][c] = (calc(r-1, c) + calc(r, c-1)) % (10**9+7)
    return paths[r][c]

print(calc(H-1, W-1))


### FIXED CODE ###

h, w = map(int, input().split())
a = [input() for _ in range(h)]
dp = [[0] * w for _ in range(h)]
 
for i in range(h):
    if a[i][0] == ".":
        dp[i][0] = 1
    else:
        break
 
for i in range(w):
    if a[0][i] == ".":
        dp[0][i] = 1
    else:
        break
 
for i in range(1, h):
    for j in range(1, w):
        if a[i][j] == "#":
            dp[i][j] = 0
        else:
            dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % (10 ** 9 + 7)
 
print(dp[h - 1][w - 1])
d,t,s=map(int, input().split())
if d/t <= s:
  print("Yes")
else:
  prinst("No")

### FIXED CODE ###

d,t,s=map(int, input().split())
if d/t <= s:
  print("Yes")
else:
  print("No")
import sympy
N = int(input())

div = sympy.divisors(N)
ans = 100

for i in range(len(div)):
    a = div[i]
    b = N // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)


### FIXED CODE ###

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())

div = make_divisors(N)
ans = 100

for d in div:
    a = d
    b = N // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)
s = list(input())
t = set[s]
if len(t) == 2 and s.count(t[0]) == 2 :
    print("Yes")
else :
    print("No")


### FIXED CODE ###

s = list(input())
t = list(set(s))
if len(t) == 2 and s.count(t[0]) == 2 :
    print("Yes")
else :
    print("No")
N, K = list(map(int, input().split()))
links = [list(map(int, input().split())) for _ in range(N-1)]
start = links[0][0]

def perm(a, b):
    s = 1
    for i in range(a-b+1, a+1):
        s *= i
    return s

if N == 1:
    print(K)
# elif K - 1 < len(d[start]):
#     print(0)
else:
    mod = 1000000007
    d = {}
    for a, b in links:
        if a in d:
            d[a].append(b)
        else:
            d[a] = [b]
    ans = K * perm(K - 1, len(d[start]))
    root = d[start]
    a = K - 2
    while True:
        children = []
        for i in root:
            if i in d:
                b = len(d[i])
                if a < b:
                    print(0)
                    break
                ans *= perm(a, b)
                children.extend(d[i])
        else:
            if children == []:
                print(ans % mod)
                break
            root = children
            continue
        break

### FIXED CODE ###

N, K = list(map(int, input().split()))
l = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = list(map(int, input().split()))
    l[a].append(b)
    l[b].append(a)

deg1 = [0] * (N + 1)
deg2 = [0] * (N + 1)
history = [True] * (N + 1)
stack = [1]
ans = 1

while stack:
    node = stack.pop()
    ans *= K - deg1[node] - deg2[node]
    ans %= 1000000007
    history[node] = False
    for child in l[node]:
        if history[child]:
            deg1[child] += 1
            deg2[child] += deg1[node]
            deg1[node] += 1
            stack.append(child)
            
print(ans)
def insertion_sort(A ,N, g):
	grobal cnt
	for i in range(g, N):
		v = A[i]
		j = i - g
		while j>=0 and A[j]>v:
			A[j+g] = A[j]
			j = j - g
			cnt += 1
			A[j+g] = v


def shell_sort(A, N):
	grobal cnt
	cnt = 0
	G = []
	h = 1
	while h<=len(A):
		G.append(h)
		h = 3*h+1
	G.reverse()
	m = len(G)
	print(m)
	print(' '.join(map(str, G)))
	for g in G:
		insertion_sort(A, N, g)
	return m, G


N = int(input())
A = [int(input()) for i in range(N)]

shell_sort(A, N)
print(cnt)
for a in A:
	print(a)



### FIXED CODE ###

def insertion_sort(A ,N, g):
	global cnt
	for i in range(g, N):
		v = A[i]
		j = i - g
		while j>=0 and A[j]>v:
			A[j+g] = A[j]
			j = j - g
			cnt += 1
			A[j+g] = v


def shell_sort(A, N):
	global cnt
	cnt = 0
	G = []
	h = 1
	while h<=len(A):
		G.append(h)
		h = 3*h+1
	G.reverse()
	m = len(G)
	print(m)
	print(' '.join(map(str, G)))
	for g in G:
		insertion_sort(A, N, g)
	return m, G


N = int(input())
A = [int(input()) for i in range(N)]

shell_sort(A, N)
print(cnt)
for a in A:
	print(a)
import numpy as np
N = int(input())
Hs = np.array(list(map(int, input().split())), dtype='int64')
As = np.tile(Hs, (N, 1))
h = As.T.copy()
L = np.array([i for i in range(N)], dtype='int64')
idxs = np.tile(L, (N, 1))
tidxs = idxs.T.copy()
co = As + h - np.abs(idxs-tidxs)
ans = N**2-np.count_nonzero(co)
print(ans//2)

### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))
L = [A[i]+i for i in range(N)]
R = [i-A[i] for i in range(N)]
c = Counter(R)

ans = 0
for l in L:
    ans += c[l]

print(ans)
INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2
 
n = int(input())
M = [list(map(int, input().split())) for i in range(n)]
for u in range(0, n):
    U = list(map(int, input().split()[2:]))
    for j in range(0, len(U), 2):
        M[u][U[j]] = U[j + 1]
d = [INFTY for i in range(n)]
color = [WHITE for i in range(n)]

def dijkstra():
    global M, d, color, n
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(n):
        print(str(i), (-1 if d[i] == INFTY else str(d[i])))
dijkstra()

### FIXED CODE ###

from sys import stdin

INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2

n = int(stdin.readline())
M = [[INFTY for i in range(n)] for j in range(n)]

for u in range(n):
    U = list(map(int, stdin.readline().split()[2:]))
    for j in range(0, len(U), 2):
        M[u][U[j]] = U[j+1]

d = [INFTY for i in range(n)]
color = [WHITE for i in range(n)]

def dijkstra():
    global n
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if(d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(
n):
        print(i, (-1 if d[i] == INFTY else d[i]))
dijkstra()
n = int(input())
h = list(map(int, input().split()))

def chmin(a, b):
    if a > b: return b
    else: return a

def rec(i):
    if dp[i] < float('inf'): return dp[i]
    
    if i == 0: return 0

    res = float('inf')
    res = chmin(res, rec(i - 1) + abs(h[i] - h[i - 1]))
    if i > 1:
        res = chmin(res, rec(i - 2) + abs(h[i] - h[i - 2]))
    dp[i] = res
    return dp[i]

dp = [float('inf')] * n
print(rec(n - 1))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))

INF = 1 << 40
dp = [INF] * n
dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(1, n - 1):
	dp[i + 1] = min(dp[i-1] + abs(h[i+1] - h[i-1]), dp[i] + abs(h[i+1] - h[i]))

print(dp[-1])
import sys
import math


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


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


n = int(input())
a = list(map(int, input().split()))
a.sort()

a_lcm = a[0]
for ai in a:
    a_lcm = lcm(ai, a_lcm)

m = a_lcm - 1
ans = 0

for ai in a:
    ans += m%ai

print(ans)

### FIXED CODE ###

import sys
import fractions


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


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


n = int(input())
a = list(map(int, input().split()))
a.sort()

a_lcm = a[0]
for ai in a:
    a_lcm = lcm(ai, a_lcm)

m = a_lcm - 1
ans = 0

for ai in a:
    ans += m%ai

print(ans)
a, b, k = list(map(int, input().split()))
if k > a:
  m = k - a
  if m < 0:
    b = 0
  else:
	b -= m
  a = 0
else:
  a = a - k
print(a, b)


### FIXED CODE ###

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

n = min(a,k)
a -= n
k -= n
print(a, max(b - k, 0))
b = int(input())
print("A" if b == "T" else "T" if b == "A" else "C" if b == "G" else "G")

### FIXED CODE ###

b = input()
print("A" if b == "T" else "T" if b == "A" else "C" if b == "G" else "G")
s=input()
count=0
i=0
while i<len(s):
    summ=0
    while s[i]=='R':
        summ+=1
        i+=1
    if summ>count:
        count=summ
    i+=1


print(count)        

### FIXED CODE ###

s=input()
count=0
i=0
while i<len(s):
    summ=0
    while i<len(s) and s[i]=='R':
        summ+=1
        i+=1
    if summ>count:
        count=summ
    i+=1


print(count)
import sys
N=int(input())
table=[]
for i in range(N):
    x,y=map(int,input().split())
    table.append((x,y))
L=[0,0]
for x,y in table:
    L[(x+y)%2]=1
if sum(L)==2:
    print(-1)
    sys.exit()
def f(x,y,m):
    s=m
    a=''
    if x>=0:
        a+='R'*x
        s-=x
    else:
        a+='L'*abs(x)
        s-=abs(x)
    if y>=0:
        a+='U'*y
        s-=y
    else:
        a+='D'*abs(y)
        s-=abs(y)
    s=s//2
    a+='LR'*s
    return a
if L[0]==1:
    m=40
    d=[1]*40
    ans=[]
    for x,y in table:
        ans.append(f(x,y,m))
else:
    m=39
    d=[1]*39
    ans=[]
    for x,y in table:
        ans.append(f(x,y,m))

print(m)
print(' '.join(map(str,d)))
for s in ans:
    print(s)

### FIXED CODE ###

import sys
N=int(input())
table=[]
for i in range(N):
    x,y=map(int,input().split())
    table.append((x,y))
L=[0,0]
for x,y in table:
    L[(x+y)%2]=1
if sum(L)==2:
    print(-1)
    sys.exit()
def f(a,b):
    pas=''
    s=a[::-1]
    t=b[::-1]
    A=[0]*31
    B=[0]*31
    for i in range(len(s)):
        if s[i]=='1':
            A[i]=1
    for i in range(len(t)):
        if t[i]=='1':
            B[i]=1
    n=31
    for i in range(n):
        if A[i]==0 and B[i]==0:
            pas+='L'
        if A[i]==0 and B[i]==1:
            pas+='D'
        if A[i]==1 and B[i]==0:
            pas+='U'
        if A[i]==1 and B[i]==1:
            pas+='R'
        
    return pas
if L[0]==1:
    m=32
    d=[1]+[pow(2,i) for i in range(31)]
    ans=[]
    S=[]
    for x,y in table:
        S.append((x-1,y))
    for x,y in S:
        a='R'
        u=(x+y+(pow(2,31)-1))//2
        v=(x-y+(pow(2,31)-1))//2
        u=bin(u)[2:]
        v=bin(v)[2:]
        a+=f(u,v)
        ans.append(a)       
else:
    m=31
    d=[pow(2,i) for i in range(31)]
    ans=[]
    S=table
    for x,y in S:
        a=''
        u=(x+y+(pow(2,31)-1))//2
        v=(x-y+(pow(2,31)-1))//2
        u=bin(u)[2:]
        v=bin(v)[2:]
        a+=f(u,v)
        ans.append(a)      

print(m)
print(' '.join(map(str,d)))
for s in ans:
    print(s)
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 998244353
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############

N,S = inputIL()
l = inputIL()

from functools import lru_cache
@lru_cache(maxsize=None)

def f(r,s):
  if s == 0:
    return (1,r+2)
  if r == 0:
    if s == l[r]:
      return (1,1)
    else:
      return (0,0)
  else:
    return (f(r-1,s)[0] + f(r-1,s)[1] + f(r-1,s-l[r])[1],f(r-1,s)[1]+f(r-1,s-l[r])[1])

print(f(N-1,S)[0])

### FIXED CODE ###

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

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

"""
dpなのはそうだろう
普通に行けば、ナップサックdpでいける
S以下のみしか保持しなくていい

始点を保持してしまうと、Sになった時に…？
始点より左にあるやつの個数の和を記録しておけばいい！

連続してなくていいから
"""

dp = [0] * (S+1)
ans = 0
mod = 998244353

for i in range(N):

    ndp = []
    for ll in dp:
        ndp.append(ll)

    if A[i] <= S:
        ndp[A[i]] += i+1
        ndp[A[i]] %= mod

    for j in range(S):

        if j+A[i] <= S:
            ndp[j+A[i]] += dp[j]
            ndp[j+A[i]] %= mod

    ans += ndp[S]
    ans %= mod

    dp = ndp

    #print (dp)

    
print (ans)
N=int(input())
A=[int(input()) for i in range(N)]
l=[]
count=0

if 1 not in A:
    print(-1)
    exit()
for i in range(N-1):
    for j in range(i+1,N):
        if A[i]>=A[j]:
            count+=1
            print(A[i],A[j])
            break

print(count)


### FIXED CODE ###

N=int(input())
A=[int(x) for x in input().split()]
ne=1
c=0

if 1 not in A:
    print(-1)
    exit()


for i in range(N-1):
    if A[i]==ne:
        c+=1
        ne+=1
if A[-1]==ne:
    c+=1
print(N-c)
n = int(input())
s = input()
x = 0
xm = float('inf')
for i in range(n):
    if s[i] == '(':
        x += 1
    elif s[i] == ')':
        x -= 1
        xm = min(xm, x)
print('(' * -xm + s + ')' * (x - xm))

### FIXED CODE ###

n = int(input())
s = input()
x = 0
y = 0
for i in range(n):
    if s[i] == '(':
        x += 1
    elif s[i] == ')':
        x -= 1
    if x < 0:
        y += 1
        x += 1
print('(' * y + s + ')' * x)
N = int(input())
A = list(map(int, input().split()))
r = 0
now = 0
ans = 0
for i in range(N):
    while N > r:
        if now & A[r] != 0:
            break
        now += A[r]
        r += 1
    s -= A[i]
    ans += r-i
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
r = 0
now = 0
ans = 0
for i in range(N):
    while N > r:
        if now & A[r] != 0:
            break
        now += A[r]
        r += 1
    now -= A[i]
    ans += r-i
print(ans)
import math

N = int(input())
T = [int(input()) for _ in range(N)]

def lcm(A, B):
    return (A * B) // math.gcd(A, B)

num = lcm(T[0], T[1])
for i in range(2, N):
    num = lcm(num, T[i])

print(num)

### FIXED CODE ###

import fractions
from functools import reduce

def lcm_base(A, B):
    return (A * B) // fractions.gcd(A, B)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = [int(input()) for _ in range(N)]

print(lcm(T))
import sys
import numpy as np
import copy
input=sys.stdin.readline
def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    lighted = np.array([0]*N)
    for i,a in enumerate(A):
        area = len(lighted[max(0,i-a):min(i+a,N-1)+1])
        lighted[max(0,i-a):min(i+a,N-1)+1] += np.array([1]*area)
    print(*A)
    print(lighted)
    
    for _ in range(K-1):
        tmp = np.array([0]*N)
        for i,a in enumerate(lighted):
            area = len(tmp[max(0,i-a):min(i+a,N-1)+1])
            tmp[max(0,i-a):min(i+a,N-1)+1] += np.array([1]*area)
        lighted = copy.deepcopy(tmp)
        if lighted[0] == N:
            break
        print(lighted)
    print(lighted)
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import copy
from itertools import accumulate
input=sys.stdin.readline
def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    ans = copy.deepcopy(A)
    for _ in range(K):
        cumsum = [0]*N
        for i,a in enumerate(ans):
            l = max(0,i-a)
            r = min(N-1,i+a)
            cumsum[l] += 1
            if r+1 < N:
                cumsum[r+1] -= 1
        ans = list(accumulate(cumsum))
        if ans[0] == N:
            break
    print(*ans)
    
if __name__ == '__main__':
    main()
# ABC109B

n = int(input())
w = [int(input()) for i in range(n)]
ok = "Yes"
e = w[0][-1]
double = [w[0]]
for i in range(1, n):
    if double.count(w[i]) != 0:
        ok = "No"
        break
    double.append(w[i])
    s = w[i][0]
    if s != e:
        ok = "No"
        break
    e = w[i][-1]
print(ok)


### FIXED CODE ###

n = int(input())
w = [input() for i in range(n)]
ok = "Yes"
e = w[0][-1]
double = [w[0]]
for i in range(1, n):
    if double.count(w[i]) != 0:
        ok = "No"
        break
    double.append(w[i])
    s = w[i][0]
    if s != e:
        ok = "No"
        break
    e = w[i][-1]
print(ok)
a,b,x = map(int,input().split())
fb = b//x+1
if a!= 0 :
    fa = (a-1)//x+1
else :
    0
print(fb-fa)

### FIXED CODE ###

a,b,x = map(int,input().split())
fb = b//x+1
if a!= 0 :
    fa = (a-1)//x+1
else :
    fa = 0
print(fb-fa)
n = int(input())

ans = []
for i in range(n):
    c = input().split()
    cmd = c[0]
    x = 0
    if 1 < len(c):
        x = int(c[1])
    if cmd == 'insert':
        y = [x] + ans
        ans = y
    elif cmd == 'delete':
        index = ans.index(x)
        ans.pop(index)
    elif cmd == 'deleteFirst':
        ans.pop(0)
    elif cmd == 'deleteLast':
        ans.pop(len(ans) - 1)

print(' '.join(map(str, ans)))

### FIXED CODE ###

import sys
from collections import deque
n = int(sys.stdin.readline())

ans = deque()

for i in range(n):
    c = sys.stdin.readline()[:-1]
    if c[0] == 'i':
        ans.appendleft(c[7:])
    elif c[6] == ' ':
        try:
            ans.remove(c[7:])
        except:
            pass
    elif c[6] == 'F':
        ans.popleft()
    else:
        ans.pop()

print(' '.join(ans))
while True:
    n,x = map(int,input().split())
    if n == x == 0:
        break
    
    d = o
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            k = x-(i+j)
            if k >= 1 and k<= n and k > j:
                d += 1
    
    print(d)
        
    


### FIXED CODE ###

while True:
    n,x = map(int,input().split())
    if n == x == 0:
        break
    
    d = 0
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            k = x-(i+j)
            if k >= 1 and k<= n and k > j:
                d += 1
    
    print(d)
[a,b,c]=[int(inp) for inp in input().split()]
#if a*a+b*b+c*c -2*(a*b+b*c+c*a) > 0:
if a(a-2*b)+b*(b-2*c)+c*(c-2*a)> 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

[a,b,c]=[int(inp) for inp in input().split()]
#if a*a+b*b+c*c -2*(a*b+b*c+c*a) > 0:
if c - a - b < 0 or a*(a-2*b)+b*(b-2*c)+c*(c-2*a)<=0:
    print("No")
else:
    print("Yes")
a=int(input(''))
b=int(input(''))
if (a*b)%2==0:
  print('Even')
else:
  print('Odd')


### FIXED CODE ###

a,b=map(int,input().split())
print("Even" if a*b%2==0 else "Odd")
c = []
direction = []
def lcsLength(s, t):
    n = len(s) + 1
    m = len(t) + 1
    global c, direction
    c = [[-1] * (m) for x in [-1] * (n)]
    direction = [[-1] * (m) for x in [-1] * (n)]
    lcsLengthMemoized(s, t, n - 1, m - 1)
    return direction

def lcsLengthMemoized(s, t, i, j):
    global c
    if c[i][j] == -1:
        if i == 0 or j == 0:
            c[i][j] = 0
            return c[i][j]
        elif s[i - 1] == t[j - 1]:
            c[i][j] = lcsLengthMemoized(s, t, i - 1, j - 1) + 1
            direction[i - 1][j - 1] = 0 # volta uma linha e uma coluna
            return c[i][j]
        else:
            top_p = lcsLengthMemoized(s, t, i - 1, j)
            left_p = lcsLengthMemoized(s, t, i, j - 1)
            if left_p >= top_p:
                c[i][j] = left_p
                direction[i - 1][j - 1] = 1 # volta uma coluna na mesma linha
            else:
                c[i][j] = top_p
                direction[i - 1][j - 1] = 2 # volta uma linha na mesma coluna
            return c[i][j]
    else:
        return c[i][j]

def getLCS(direction, s, i, j, lcs=""):
    if i < 0 or j < 0:
        return lcs
    if direction[i][j] == 0: # volta uma linha e uma coluna
        lcs += getLCS(direction, s, i - 1, j - 1, lcs)
        lcs += s[i]
        return lcs
    elif direction[i][j] == 2: # volta uma linha na mesma coluna
        lcs += getLCS(direction, s, i - 1, j, lcs)
    else: # volta uma coluna na mesma linha
        lcs += getLCS(direction, s, i, j - 1, lcs)
    return lcs

s = input()
t = input()
d = lcsLength(s, t)
print(getLCS(d, s, len(d) - 2, len(d[0]) - 2))

### FIXED CODE ###

s = input()
t = input()

m = len(s)
n = len(t)

dp = [[None] * (n+1) for i in range(m+1)]

for i in range(m+1):
    for j in range(n+1):

        if i == 0 or j == 0:
            dp[i][j] = 0

        elif s[i-1] == t[j-1]:
            dp[i][j] = dp[i-1][j-1] + 1

        else:
            dp[i][j] = max(dp[i-1][j],dp[i][j-1])



final = dp[m][n]

lcs = [""] * (final + 1)
lcs[final] = ""

i = m
j = n

while i > 0 and j > 0:
    if s[i-1] == t[j-1]:
        lcs[final-1] = s[i-1]
        i -= 1
        j -= 1
        final -= 1

    elif dp[i-1][j] > dp[i][j-1]:
        i -= 1
    else:
        j -= 1


print("".join(lcs))
n, total = map(int, input().split())
min = n * 1000
max = n * 10000
if (total > max) or (total < min):
    print('-1 -1 -1')
else:
    min_man = (total - (5000 * n)) // 10000
    n -= min_man
    total -= min_man*10000
    min_sen = (total % 5000) // 1000
    total -= min_sen*1000
    n -= min_sen
    success = False
    for i in range(int(total // 10000)+1):
        if success:
            break
        ii = total - i*10000
        for j in range(int(ii // 5000)+1):
            jj = ii - j*5000
            k = jj//1000
            if i + j + k + min_sen + min_man == n:
                print(str(i+min_man) + ' ' + str(j) + ' ' + str(k+min_sen))
                success = True
                break

    if not success:
        print('-1 -1 -1')


### FIXED CODE ###

n = int(input())
mochis = []
for i in range(n):
  mochis.append(int(input()))
print(len(set(mochis)))