Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N, K = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)

if N == 1:
	if a[0] >= K:
		print(0)
	else:
		print(1)

else:
	def check(i):
		if a[i] >= K:
			return True
		if i == 0:
			b = a[1:]
		elif i == N - 1:
			b = a[:N - 1]
		else:
			b = a[:i] + a[i+1:]
		#print(b)
		#ok = False
		#dp = [[False] * K for _ in range(N - 1)]
		dp = [False] * K
		#dp[0] = True
		if b[0] < K:
			#dp[0][b[0]] = True
			dp[b[0]] = True
		if K - a[i] <= b[0] < K:
			return True
		for j in range(1, N - 1):

			dp2 = [False] * K
			#if b[j] < K:
				#dp[b[j]] = True
			for k in range(1, K):
				#if b[j] == K:
				#	return True
				#elif dp[j - 1][k] == True:
				if dp[k] == True:
					dp2[k] = True
				
				#elif k > b[j]:
				
				if k >= b[j]:
					#if dp[j - 1][k - b[j]] == True:
					if dp[k - b[j]] == True:
						#dp[j][k] = True
						dp2[k] = True

				#if dp[j][k] == True and K - a[i] <= k < K:
				if dp2[k] == True and K - a[i] <= k:
					return True

			#print(dp)
			dp = dp2

		return False


	def bi_search(lower, upper):
		#print(lower, upper)
		mid = (lower + upper) // 2
		#print(mid)
		if mid == 0 and check(mid) == True:
			return 0
		elif mid == N - 2 and check(mid + 1) == False:
			return N
		elif check(mid) == False and check(mid + 1) == True:
			#print("hoge")
			return mid + 1
		elif check(mid) == True:
			return bi_search(lower, mid)
		else:
			return bi_search(mid, upper)


	print(bi_search(0, N - 1))


### FIXED CODE ###

import sys

n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
#print(a)
fr = 0
ba = n+1

def check(mi):
    x = a[mi-1]
    if x >= k:
        return True
    #print(mi)
    dp = [False] * (k+1)
    dp[0] = True
    for i in range(n):
        if i == mi-1:
            continue
        y = a[i]
        for j in range(k, -1, -1):
            if j >= y:
                dp[j] = dp[j] | dp[j-y]

    if sum(dp[k-x:k]):
        return True
    else:
        return False

if check(1):
    print(0)
    sys.exit()

if not check(n):
    print(n)
    sys.exit()

while ba-fr > 1:
    mi = (ba+fr+1) // 2
    if check(mi):
        ba = mi
    else:
        fr = mi

print(fr)
### BUGGY CODE ###

import queue
H, W = map(int, input().split())
S = [list(map(int, input().replace(".", "0").replace("#","1"))) for h in range(H)]

Search = [(-1, 0), (0, -1), (1, 0), (0, 1)]
Total = 0
Visited = [[False for w in range(W)] for h in range(H)]
for h in range(H):
    for w in range(W):
        if not Visited[h][w]:
            Visited[h][w] = True
            Color = ([1, 0] if S[h][w] == 0 else [0, 1])
            Q = queue.Queue()
            Q.put((h, w, S[h][w]))
            while not Q.empty():
                nh, nw, nc = Q.get()
                for s in Search:
                    nexth, nextw = nh + s[0], nw + s[1]
                    if 0 <= nexth < H and 0 <= nextw < W:
                        if not Visited[nexth][nextw] and S[nexth][nextw] != nc:
                            nextc = S[nexth][nextw]
                            Visited[nexth][nextw] = True
                            Q.put((nexth, nextw, nextc))
                            Color[nextc] += 1
            Total += Color[0] * Color[1]

print(Total)

### FIXED CODE ###

import queue
H, W = map(int, input().split())
S = [list(map(int, input().replace(".", "0").replace("#","1"))) for h in range(H)]

Search = [(-1, 0), (0, -1), (1, 0), (0, 1)]
Total = 0
Visited = [[False for w in range(W)] for h in range(H)]
for h in range(H):
    for w in range(W):
        if not Visited[h][w]:
            Visited[h][w] = True
            Color = ([1, 0] if S[h][w] == 0 else [0, 1])
            Q = queue.Queue()
            Q.put((h, w, S[h][w]))
            while not Q.empty():
                nh, nw, nc = Q.get()
                for s in Search:
                    nexth, nextw = nh + s[0], nw + s[1]
                    if 0 <= nexth < H and 0 <= nextw < W:
                        if not Visited[nexth][nextw] and S[nexth][nextw] != nc:
                            nextc = S[nexth][nextw]
                            Visited[nexth][nextw] = True
                            Q.put((nexth, nextw, nextc))
                            Color[nextc] += 1
            Total += Color[0] * Color[1]

print(Total)
### BUGGY CODE ###

n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
    a,b=map(int, input().split())
    x.append(a)
    y.append(b)
    m.append([a,b])
x.sort()
y.sort()
ans=float('inf')
for i in range(n-1):
    for j in range(i,n):
        if i>=j:continue
        for k in range(n-1):
            for l in range(k,n):
                if k>=l:continue
                count=0
                for a,b in m:
                    if x[i]<=a<=x[j] and y[k]<=b<=y[l]:
                        count+=1
                if count>=t:
                    ans=min(ans,(x[j]-x[i])*(y[l]-y[k]))
print(ans)
    

### FIXED CODE ###

n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
    a,b=map(int, input().split())
    x.append(a)
    y.append(b)
    m.append([a,b])
x.sort()
y.sort()
ans=float('inf')
for i in range(n-1):
    for j in range(i,n):
        if i>=j:continue
        for k in range(n-1):
            for l in range(k,n):
                if k>=l:continue
                count=0
                for a,b in m:
                    if x[i]<=a<=x[j] and y[k]<=b<=y[l]:
                        count+=1
                if count>=t:
                    ans=min(ans,(x[j]-x[i])*(y[l]-y[k]))
print(ans)
### BUGGY CODE ###

s = input()
n = len(s)


cnt = 0

idx01 = s.find('01')
idx10 = s.find('10')
cnt01 = s.count('01')
cnt10 = s.count('10')

while idx01 != -1 or idx10 != -1:
    if idx01 == -1 and idx10 == -1:
        print(cnt)
        exit()
    if idx01 == -1:
        idx01 = 1000000
    if idx10 == -1:
        idx10 = 1000000
    if cnt01 >= cnt10:
        s = s.replace('01', '', cnt01)
        cnt += cnt01
    else:
        s = s.replace('10', '', cnt10)
        cnt += cnt10

    idx01 = s.find('01')
    idx10 = s.find('10')
    cnt01 = s.count('01')
    cnt10 = s.count('10')

print(cnt * 2)

### FIXED CODE ###

s = input()
n = len(s)
cnt = []
cnt.append(s.count('0'))
cnt.append(s.count('1'))

print(2 * min(cnt))
### BUGGY CODE ###

import fractions

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

for i in range(int(n/2) + 1):
    x = 0
    for j in range(n):
        if j != i:
            x = fractions.gcd(x, a[j])
    t.append(x)

print(max(t))

### FIXED CODE ###

from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
result = []

left = [0] * (n+1)
right = [0] * (n+1)
for i in range(n):
    left[i+1] = gcd(left[i], a[i])
for j in range(n-1, -1, -1):
    right[j] = gcd(right[j+1], a[j])
for i in range(n):
    result.append(gcd(left[i], right[i+1]))

print(max(result))
### BUGGY CODE ###

import sys

input = sys.stdin.readline

def main():
    ans = 0
    mod = (10**9)+7
    n = int(input())
    a = list(map(int, input().split()))
    for i in range(n):
        for j in range(i, n):
           ans += a[i]*a[j]
    for i in a:
        ans -= i**2 
    print(ans%mod)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

input = sys.stdin.readline

def main():
    ans = 0
    mod = (10**9)+7
    n = int(input())
    a = list(map(int, input().split()))
    suma = sum(a)
    for i in range(n-1):
        suma -= a[i]
        ans += a[i]*suma
    print(ans%mod)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import math
import sys
from decimal import *

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

getcontext().prec = 21

aa = [Decimal(b).log10() for b in a if a != 0]

ans = Decimal('0')

for c in aa:
    ans += c


if ans > 18.0:
    print(-1)
else:
    ans = 1
    for c in a:
        ans *= c
    print(ans)


### FIXED CODE ###

n = int(input())

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

ans = 1

for b in a:
    if b == 0:
        ans = 0
        break
    else:
        ans *= b
        if ans > pow(10, 18):
            ans = -1
            break

print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
t = dict()
nt = dict()

for i in range(1, n+1):
    t[i] = set()

for a, b in ab:
    t[a].add(b)
    t[b].add(a)

s = set()
ans = dict()
for i in range(1, n+1):
    if len(s) == n:
        break
    if i not in s:
        ans[i] = []
        for j in range(i+1, n+1):
            if j not in t[i] and j not in s and ("".join(map(str, sorted(list(t[j])))) not in "".join(map(str, sorted(list(t[i])))) or len(t[j]) == 0):
                ans[i].append(j)
                s.add(j)
                t[i] = t[i] | t[j]
print(len(ans))


### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
t = dict()
for i in range(1, n+1):
    t[i] = set()
for a, b in ab:
    t[a].add(b)
    t[b].add(a)

q = deque()
s = set()
ans = 0
for i in range(1, n+1):
    if i not in s:
        q.append(i)
        s.add(i)
        tmp = [i]
        while q:
            v = q.popleft()
            for ti in t[v]:
                if ti not in s:
                    tmp.append(ti)
                    q.append(ti)
                    s.add(ti)
    ans = max(ans, len(tmp))
print(ans)
### BUGGY CODE ###

S = list(input().strip())
T = list(input().strip())

for i in range(len(S)):
    s_idx = [j for j, c in enumerate(S) if c == S[i]]
    t_idx = [j for j, c in enumerate(T) if c == T[i]]

    if s_idx != t_idx:
        print('No')
        exit()

print('Yes')

### FIXED CODE ###

S = input().strip()
T = input().strip()

s_dict = {}
for i in range(len(S)):
    if not S[i] in s_dict:
        s_dict[S[i]] = T[i]

    elif s_dict[S[i]] != T[i]:
        print('No')
        exit()

t_dict = {}
for i in range(len(T)):
    if not T[i] in t_dict:
        t_dict[T[i]] = S[i]

    elif t_dict[T[i]] != S[i]:
        print('No')
        exit()

print('Yes')
### BUGGY CODE ###

from collections import deque

n,m,k=map(int,input().split())
fre=[[]for _ in range(n)]
blo=[[] for _ in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    fre[a-1].append(b-1)
    fre[b-1].append(a-1)
for i in range(k):
    c,d=map(int,input().split())
    blo[c-1].append(d-1)
    blo[d-1].append(c-1)

for i in range(n):
    l=deque([i])
    ans=0
    cnt=[0]*n
    cnt[i]=1
    for b in blo[i]:
        cnt[b]=-1
    while l:
        now=l.popleft()
        for to in fre[now]:
            if cnt[to]==0:
                cnt[to]=1
                l.append(to)
                ans+=1
            if cnt[to]==-1:
                l.append(to)
    ans-=len(fre[i])
    print(ans)

### FIXED CODE ###

from collections import deque

n,m,k=map(int,input().split())
fre=[[]for _ in range(n)]
blo=[[] for _ in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    fre[a-1].append(b-1)
    fre[b-1].append(a-1)
for i in range(k):
    c,d=map(int,input().split())
    blo[c-1].append(d-1)
    blo[d-1].append(c-1)

cnt=[0]*n
l=deque()
x=1
dic={}
for i in range(n):
    if cnt[i]==0:
        l.append(i)
    while l:
        now=l.popleft()
        for to in fre[now]:
            if cnt[to]==0:
                cnt[to]=x
                if x in dic:
                    dic[x]+=1
                else:
                    dic[x]=1
                l.append(to)
    x+=1

for i in range(n):
    if dic=={}:
        print(0)
    else:
        k=len(fre[i])
        for b in blo[i]:
            if cnt[b]==cnt[i]:
                k+=1
        if cnt[i] in dic:
            print(dic[cnt[i]]-k-1)
        else:
            print(0)
### BUGGY CODE ###

from itertools import accumulate
n, K = map(int,input().split())
A = list(map(int,input().split()))
b = [0 for _ in range(n+1)]

for _ in range(K):
    for i,a in enumerate(A):
        b[max(0, i-a)] += 1
        b[min(n, i+a+1)] -= 1

    ac = list(accumulate(b))
    A = ac[:-1]
    b = [0 for _ in range(n+1)]
    if sum(A) == n*n:
        break
    
print(*A)

### FIXED CODE ###

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

for _ in range(K):
    b = [0 for _ in range(n+1)]
    for i,a in enumerate(A):
        b[max(0, i-a)] += 1
        b[min(n, i+a+1)] -= 1

    for i in range(n):
        b[i+1] += b[i]

    A = b[:-1]
    if all(a == n for a in A):
        break
print(*A)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 1000000007
ans = 0
for i in range(n-1):
  for j in range(i+1, n):
    ans += a[i] ^ a[j]
    ans %= mod
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 1000000007
ml = len(bin(max(a)))-2
ans = 0
for i in range(ml):
  x = sum([1 for j in a if ((j>>i) & 1)])
  ans += x*(n-x)*(2**i)
  ans %= mod
print(ans)
### BUGGY CODE ###

import sys
S=list(raw_input())

cnt=0
while len(S)>1:
	#print S,cnt
	if S[0]==S[-1]:
		S.pop(0)
		S.pop()
	elif S[0]!=S[-1] and S[0]=="x":
		cnt+=1
		S.append("x")
	elif S[0]!=S[-1] and S[-1]=="x":
		cnt+=1
		S.insert(0,"x")
	else:
		print "-1"
		sys.exit()
print cnt

### FIXED CODE ###

import sys
S=raw_input()

cnt=0
while len(S)>1:
	#print S,cnt
	if S[0]==S[-1]:
		S=S[1:-1]
	elif S[0]!=S[-1] and S[0]=="x":
		cnt+=1
		S=S+"x"
	elif S[0]!=S[-1] and S[-1]=="x":
		S="x"+S
		cnt+=1
	else:
		print "-1"
		sys.exit()
print cnt
### BUGGY CODE ###

l, r = map(int, input().split())
count = int()
baff = set()
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
            baff.add((i * j) % 2019)
print(min(baff))

### FIXED CODE ###

l, r = map(int, input().split())
count = int()
baff = set()
if l <= 3 and r >= 673:
    print(0)
else:
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
                baff.add((i * j) % 2019)
                if (i * j) % 2019 == 0:
                    break
        else:
            continue
        break
    print(min(baff))
### BUGGY CODE ###

import heapq


class Reverse:
    def __init__(self, val):
        self.val = val

    def __lt__(self, other):
        return self.val > other.val

    def __repr__(self):
        return repr(self.val)


class Heapq:
    def __init__(self, arr, desc=False):
        if desc:
            for i in range(len(arr)):
                arr[i] = Reverse(arr[i])
        self.desc = desc
        self.hq = arr
        heapq.heapify(self.hq)

    def pop(self):
        if len(self.hq) == 0:
            return None
        if self.desc:
            return heapq.heappop(self.hq).val
        else:
            return heapq.heappop(self.hq)

    def push(self, a):
        if self.desc:
            heapq.heappush(self.hq, Reverse(a))
        else:
            heapq.heappush(self.hq, a)

    def top(self):
        if self.desc:
            return self.hq[0].val
        else:
            return self.hq[0]

    def __len__(self):
        return len(self.hq)


n, m = map(int, input().split(' '))
ab = []
for _ in range(n):
    ab.append(list(map(int, input().split(' '))))

ans = 0
h = Heapq([], desc=True)
for i in range(1, m+1):
    for j in filter(lambda x: x[0] == i, ab):
        h.push(j[1])
    if len(h) == 0:
        continue
    ans += h.pop()
print(ans)


### FIXED CODE ###

import heapq


class Reverse:
    def __init__(self, val):
        self.val = val

    def __lt__(self, other):
        return self.val > other.val

    def __repr__(self):
        return repr(self.val)


class Heapq:
    def __init__(self, arr, desc=False):
        if desc:
            for i in range(len(arr)):
                arr[i] = Reverse(arr[i])
        self.desc = desc
        self.hq = arr
        heapq.heapify(self.hq)

    def pop(self):
        if len(self.hq) == 0:
            return None
        if self.desc:
            return heapq.heappop(self.hq).val
        else:
            return heapq.heappop(self.hq)

    def push(self, a):
        if self.desc:
            heapq.heappush(self.hq, Reverse(a))
        else:
            heapq.heappush(self.hq, a)

    def top(self):
        if self.desc:
            return self.hq[0].val
        else:
            return self.hq[0]

    def __len__(self):
        return len(self.hq)


n, m = map(int, input().split(' '))
ab = []
for _ in range(n):
    a, b = map(int, input().split(' '))
    if a > m:
        continue
    ab.append((a, b))
ab.sort(reverse=True)

ans = 0
h = Heapq([], desc=True)
for i in range(1, m+1):
    while ab and ab[-1][0] <= i:
        a, b = ab.pop()
        h.push(b)
    if h:
        ans += h.pop()
print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
P = list(map(int,input().split()))
check = [0]*1001
tmp_p = []
for p in P:
    if check[p]!=0:
        tmp_p.append(check[p])
    else:
        tmp = ((1+p)*p/2)/p
        tmp_p.append(tmp)
ans = 0
for i in range(n-k+1):
    ans = max(ans, sum(tmp_p[i:k+i]))
print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
P = list(map(int,input().split()))
check = [0]*1001
tmp_p = []
for p in P:
    if check[p]!=0:
        tmp_p.append(check[p])
    else:
        tmp = ((1+p)*p/2)/p #期待値の計算
        tmp_p.append(tmp)
ans = sum(tmp_p[0:k])
tmp_ans = ans
for i in range(n-k):
    tmp_ans += (tmp_p[k+i]-tmp_p[i])
    ans = max(ans, tmp_ans)
print(ans)
### BUGGY CODE ###

import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

if __name__=='__main__':
    n,k = IL()
    a = list(IL())
    l = n-k+1
    b = [1]*(l)
    for i in range(l):
        for j in range(k):
            b[i]*=a[j+i]
    for i in range(1,l):
        if b[i-1]<b[i]:
            print('Yes')
        else:
            print('No')
    exit()

### FIXED CODE ###

import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

if __name__=='__main__':
    n,k = IL()
    a = list(IL())
    l = n-k
    pre = b = 0
    for i in range(l):
        if a[i]<a[i+k]:
            print('Yes')
        else:
            print('No')
    exit()
### BUGGY CODE ###

import math

def prime_judge(n):
    if n==1:
        return False
    elif n==2:
        return True
    elif n%2==0:
        return False
    else:
        sqrt_num=math.ceil(math.sqrt(n))+1
        for i in range(3,sqrt_num, 2):
            if n%i==0:
                return False
        return True

def prime_count(n):
    count=0
    for i in range(1,n+1):
        if prime_judge(i):
            count+=1
    print(count)

while 1:
    try:
        prime_count(int(input()))        
    except:
        break


### FIXED CODE ###

def prime_judge(n):
    if n==1:
        return False
    elif n==2:
        return True
    elif n%2==0:
        return False
    else:
        sqrt_num=int(n**0.5)+1
        for i in range(3,sqrt_num, 2):
            if n%i==0:
                return False
        return True

prime=[0]
for i in range(1,1000000):
    if prime_judge(i):
        prime.append(prime[-1]+1)
    else:
        prime.append(prime[-1])

while 1:
    try:
        print(prime[int(input())])     
    except:
        break
### BUGGY CODE ###

n = int(input())
a = []

for _ in range(n):
    x = int(input())
    if x in a:
        a.remove(x)
    else:
        a.append(x)

print(len(a))


### FIXED CODE ###

n = int(input())
a = sorted([int(input()) for _ in range(n)])
ans = 0
count = 0
pre = a[0]

for i in range(n):
    if a[i] == pre:
        count+=1
    else:
        pre = a[i]
        if count%2 == 1:
            ans += 1
        count = 1
if count%2 == 1:
    ans += 1
print(ans)
### BUGGY CODE ###

a,b,x=map(int,input().split())
cnt=0
for i in range(a,b+1):
    if i%x==0:
        cnt+=1
    else:
        continue
print(cnt)

### FIXED CODE ###

a,b,x=map(int,input().split())
if a==0 : print((b//x)+1)
else : print((b//x)-(a-1)//x)
### BUGGY CODE ###

import numpy as np
N,S,Q,*K = open(0).read().split()
N = int(N)
K = map(int,K)
S = np.array(list(S))
C = S=='C'
M = S=='M'
Ms = np.cumsum(M)
for k in K:
  kMs = np.copy(Ms)
  kMs[k:] = Ms[k:] - Ms[:-k]
  CMS = C*kMs
  SDMC = 0
  SMC = 0
  SC = 0
  for i in range(N-1,-1,-1):
    if i<=N-1-k:
      SC -= C[i+k]
      SMC -= CMS[i+k]
    if S[i]=='C':
      SC += 1
    elif S[i]=='M':
      SMC += SC
    elif S[i]=='D':
      SDMC += SMC
  print(SDMC)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
S = np.frombuffer(readline().rstrip(),'S1')
Q = int(readline())
query = map(int,read().split())

isD = S == b'D'
isM = S == b'M'
isC = S == b'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

def F(K):
    """
    ・Cごとに数える。
    ・そのためには(i-K,i] 内のDMの個数を調べる（負インデックスには関係ない文字があると思っておく）
    ・区間内のDの個数、Mの個数が取得できれば、差分が取得できるので最後に累積和
    """
    # (i-K,i]内のDの個数、Mの個数
    D = cumD.copy(); D[K:] -= cumD[:-K]
    M = cumM.copy(); M[K:] -= cumM[:-K]
    # 最後がMのとき、Dの個数分増える
    DM = isM * D
    # 左端のDを捨てるとき、Mの個数分減る
    DM[K:] -= isD[:-K] * M[K-1:-1]
    np.cumsum(DM,out=DM)
    # Cごとに集計
    return DM[isC].sum()

print('\n'.join(str(F(K)) for K in query))
### BUGGY CODE ###

N, K = map(int, input().split())
list=list(map(int, input().split()))
a=[]
for i in list:
    a.append(sum(range(i+1))/i)
b=[]
ma=0
for i in range(N+K-1):
    ma = max(ma, sum(a[i:i+K]))
print(ma)

### FIXED CODE ###

N, K = map(int, input().split())
list=list(map(int, input().split()))
a=[]
sum=0
for i in list:
    sum+=((i-1)*(1/2)+1)
    a.append(sum)
ma=a[K-1]
for i in range(N-K):
    ma = max(ma, a[i+K]-a[i])
print(ma)
### BUGGY CODE ###

from collections import deque
n = int(input())
items = deque()
item = tuple(input() for _ in range(n))

for i in range(n):
    if item[i] not in items:
        items.append(item[i])

print(len(items))

### FIXED CODE ###

n = int(input())
items = {}

for i in range(n):
    item = input()
    items[item] = True

print(len(items))
### BUGGY CODE ###

n = int(input())
x = [[int(i) for i in input().split()] for  i in range(n-1)]
for j in range(n-1):
	answer = x[j][0]+x[j][1]
	for k in range(j+1,n-1):
		num = x[k][1]
		while num<answer: num+=x[k][2]
		answer = num+x[k][0]
	print(answer)
print(0)

### FIXED CODE ###

n = int(input())
c,s,f = [0]*(n-1),[0]*(n-1),[0]*(n-1)
for i in range(n-1): c[i],s[i],f[i] = (int(i2) for i2 in input().split())
for j in range(n):
	answer = 0
	for k in range(j,n-1):
		if answer<s[k]: answer = s[k]
		elif answer%f[k]: answer += f[k]-(answer%f[k])
		answer += c[k]
	print(answer)
### BUGGY CODE ###

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

dp = [10**18] * n
dp[0] = 0

for i in range(n):
    for j in range(1, k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], abs(h[i+j] - h[i]) + dp[i])
    
print(dp[-1])

### FIXED CODE ###

n,k = map(int,input().split())
li = [int(x) for x in input().split()]

dp = [10**8] * n

for i in range(n):
    if i == 0:
        dp[0] = 0
    elif i < k-1:
        temp = []
        for j in range(i):
            s = abs(li[i] - li[i-j-1]) + dp[i-j-1]
            temp.append(s)
        else:
            dp[i] = min(temp)
    elif i >= k-1:
        temp = []
        for j in range(k):
            s = abs(li[i] - li[i-j-1]) + dp[i-j-1]
            temp.append(s)
        else:
            dp[i] = min(temp)
            
print(dp[-1])