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

import bisect


def count_lower(A, x):
    # Aの要素のうちxより小さいものの個数
    return bisect.bisect_left(A, x)


def count_higher(A, x):
    # Aの要素のうちxより大きいものの個数
    return len(A)-bisect.bisect_right(A, x)


def count_pair(A, x):
    # A内のペアで積がxより小さいものの個数
    N = len(A)
    cnt = 0
    for n in range(N - 1):
        if A[n] < 0:
            y = x // A[n]
            # n+1番以降でyより大きいものの個数
            cnt += count_higher(A[n+1:], y)
        elif A[n] > 0:
            y = -(-x // A[n])
            # n+1番以降でyより小さいものの個数
            cnt += count_lower(A[n+1:], y)
        else:
            if x > 0:
                cnt += N - n - 1
    return cnt


# count_pair(x)<Kをみたすxの最大値を求める
N, K = map(int, input().split())
* A, = map(int, input().split())
A.sort()
max_A = max(A)
min_A = min(A)
inf = max(max_A**2, min_A**2, abs(max_A*min_A))
l, r = -inf, inf
while r - l > 1:
    c = (l + r) // 2
    if count_pair(A, c) < K:
        l = c
    else:
        r = c
print(l)


### FIXED CODE ###

import numpy as np


def count_pair(x):
    # A内のペアで積がxより小さいものの個数
    # まず(i,j)と(j,i)を重複して数える
    cnt = 0
    # A[i]<0なる各iに対してA[j]>x/A[i]なるjの個数
    cnt += (N-np.searchsorted(A, x//A_nega, side='right')).sum()
    if x > 0:
        # 各iに対してA[j]=0なるjの個数
        cnt += len(A_zero)*N
    # A[i]>0なる各iに対してA[j]<x/A[i]なるjの個数
    cnt += np.searchsorted(A, -(-x//A_posi), side='left').sum()
    # i=jを除いてから2で割る
    cnt = (cnt-(A**2 < x).sum())//2
    return cnt


# count_pair(x)<Kをみたすxの最大値を二分探索で求める
N, K = map(int, input().split())
* A, = map(int, input().split())
A = np.array(A)
A = np.sort(A)
A_posi = A[A > 0]
A_zero = A[A == 0]
A_nega = A[A < 0]
inf = 10**18+1
l, r = -inf, inf
while r - l > 1:
    c = (l + r) // 2
    if count_pair(c) < K:
        l = c
    else:
        r = c
print(l)
### BUGGY CODE ###

from copy import deepcopy
from collections import deque

H, W = map(int, input().split())
A = [input() for _ in range(H)]

D = [[0] * W for _ in range(H)]

Q = deque()
Q1 = deque()
for i in range(H):
    for j in range(W):
        if A[i][j] == '#':
            D[i][j] = 1
            Q.append([i, j])

yudlr = [1, -1, 0, 0]
xudlr = [0, 0, -1, 1]

C = 0
while len(Q) > 0:
    C += 1
    Q1 = deepcopy(Q)
    Q.clear()
    while len(Q1) > 0:
        q = Q1.popleft()
        y = q[0]
        x = q[1]
        for i in range(4):
            y1 = y + yudlr[i]
            x1 = x + xudlr[i]
            if y1 < 0 or y1 >= H or x1 < 0 or x1 >= W:
                continue
            if D[y1][x1] == 1:
                continue
            D[y1][x1] = 1
            Q.append([y1, x1])

print(C - 1)

### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
A = [list(input()) for i in range(H)]
Q = deque()
h = 0
for i in range(H):
    for j in range(W):
        if A[i][j] == '#':
            Q.append([i, j])
        else:
            h += 1
Qtmp = deque()

yudrl = [0, 1, 0, -1]
xudrl = [1, 0, -1, 0]

c = 0
while h > 0:
    c += 1
    while len(Q) > 0:
        Qtmp.append(Q.pop())
    while len(Qtmp) > 0:
        q = Qtmp.pop()

        for i in range(4):
            y = q[0] + yudrl[i]
            x = q[1] + xudrl[i]

            if y < 0 or y > H - 1 or x < 0 or x > W - 1:
                continue
            if A[y][x] == '#':
                continue
            A[y][x] = '#'
            h -= 1
            Q.append([y, x])
print(c)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
def solve():
    global h, dp, K
    N, K = map(int,input().split())
    h = list(map(int,input().split()))
    dp = [float('inf')] * N

    dp[0] = 0
    print(rec(N-1))

def rec(i):
    if dp[i] != float('inf'):
        return dp[i]
    if i == 0:
        return 0
    
    res = float('inf')
    for j in range(1,K+1):
        if i-j < 0:
            break
        res = min(res, rec(i-j) + abs(h[i] - h[i-j]))
    
    dp[i] = res
    return res

if __name__ == '__main__':
    solve()


### FIXED CODE ###

def solve():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))

    dp = [float('inf')] * N
    dp[0] = 0
    for i in range(1, N):
        lst = []
        for k in range(1,i+1):
            if k > K:
                break
            lst.append(abs(h[i] - h[i-k]) + dp[i-k])
        
        lst.append(dp[i])
        dp[i] = min(*lst)
    
    print(dp[N-1])

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

#  入力
N = int(input())
A = [int(x) for x in input().split()]

# 初期化
dp = [[0] * (N+1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(0,N):

    # 最も嬉しさの高い子供から場所を選択していく
    a = max(A)
    id = A.index(a)
    
    for x in range(0,i+1):
        y = i - x

        d = dp[x][y]
        tmp = d + a * (id - x)
        if dp[x+1][y] < tmp:
        	dp[x+1][y] = tmp
        tmp = d + a * (((N-1)-y) - id)            
        if dp[x][y+1] < tmp:
        	dp[x][y+1] = tmp
        
    A[id] = 0

ans = 0
for i in range(N+1):
    ans = max(ans, dp[i][N-i])
print(ans)

### FIXED CODE ###

#  入力
N = int(input())
A = [int(x) for x in input().split()]

# 初期化
dp = [[0] * (N+1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(0,N):

    # 最も嬉しさの高い子供から場所を選択していく
    a = max(A)
    id = A.index(a)
    
    for x in range(0,i+1):
        y = i - x

        d = dp[x][y]
        tmp = d + a * (id - x)
        if dp[x+1][y] < tmp:
        	dp[x+1][y] = tmp
        tmp = d + a * (((N-1)-y) - id)            
        if dp[x][y+1] < tmp:
        	dp[x][y+1] = tmp
        
    A[id] = 0

ans = 0
for i in range(N+1):
    ans = max(ans, dp[i][N-i])
print(ans)
### BUGGY CODE ###

n = int(input())

ans = []

for _ in range(n):
    s = input()

    if s in ans:
        pass
    else:
        ans.append(s)

print(len(ans))

### FIXED CODE ###

n = int(input())

ans = {}

for _ in range(n):
    s = input()

    ans[s] = 1

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

a,b=map(int,input().split())
lista=[]
import fractions
gcd=fractions.gcd(a,b)

for i in range(2,gcd+1): 
    if gcd% i == 0: 
        lista.append(i)

#print(lista)
listb=[]
for i in range(len(lista)):
    flag = True
    for j in range(len(listb)):
        if lista[i]%listb[j]==0:
            flag = False    
    if flag==True:
        listb.append(lista[i])

print(len(listb)+1)



### FIXED CODE ###

a,b=map(int,input().split())
lista=[]
import fractions
import math
gcd=fractions.gcd(a,b)

for i in range(1,int(gcd**0.5)+1): 
    if gcd% i == 0: 
        lista.append(i)
        if i!=int(gcd/i):
            lista.append(int(gcd/i))

#print(lista)
lista=lista[1:]
lista.sort()
listb=[]
for i in range(len(lista)):
    flag = True
    for j in range(len(listb)):
        if lista[i]%listb[j]==0:
            flag = False    
    if flag==True:
        listb.append(lista[i])

print(len(listb)+1)
### BUGGY CODE ###

N = int(input())

count = 0
for i in range(1, N):
  count += i % (i + 1)
print(count)

### FIXED CODE ###

N = int(input())
 
print(N * (N - 1) // 2)
### BUGGY CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(m):
  b,c=map(int,input().split())
  a+=[c]*b
print(sum(sorted(a,reverse=True)[:n]))

### FIXED CODE ###

n,m=map(int,input().split())
from collections import defaultdict
d=defaultdict(int)
for k in map(int,input().split()):
  d[k]+=1
for i in range(m):
  b,c=map(int,input().split())
  d[c]+=b
sm=0
c=0

for k,v in sorted(d.items(),reverse=True):
  if c+v<n:
    sm+=k*v
    c+=v
  elif c+v==n:
    sm+=k*v
    break
  else:
    sm+=k*(n-c)
    break
print(sm)
### BUGGY CODE ###

s=input()

max_len=0
tmp=""

for i in range(1,len(s)+1):
  last=s[:i]
  cnt=1
  for s_ in s[i:]:
    tmp+=s_
    if tmp != last:
      last=tmp
      tmp=''
      cnt+=1
  max_len=max(max_len,cnt)

print(max_len)

### FIXED CODE ###

s=input()

max_len=0
tmp=""

for i in range(1,min(len(s)+1,3)):
  last=s[:i]
  cnt=1
  for s_ in s[i:]:
    tmp+=s_
    if tmp != last:
      last=tmp
      tmp=''
      cnt+=1
  max_len=max(max_len,cnt)

print(max_len)
### BUGGY CODE ###

a, b, n = map(int, input().split())
ans = 0
for i in range(int(b/a), n+1):
  if ans < (int(a*i/b)-a*int(i/b)):
    ans = int(a*i/b)-a*int(i/b)
print(ans)

### FIXED CODE ###

a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)
### BUGGY CODE ###

import sys
import os
import fractions
import itertools

def file_input():
    f = open('Beginner_Contest_162/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    K=int(input())
    # map(int, input().split())
    sum=0

    combi_l = itertools.combinations_with_replacement(range(1,K+1),3)
    # print(combi_l)

    for combi in combi_l:
        # print(combi)
        if combi[0]==combi[1]==combi[2]:
            sum+=fractions.gcd(fractions.gcd(combi[0],combi[1]),combi[2])
        elif combi[0]==combi[1] or combi[1]==combi[2] or combi[2]==combi[0]:
            sum+=3*fractions.gcd(fractions.gcd(combi[0],combi[1]),combi[2])
        else:
            sum+=6*fractions.gcd(fractions.gcd(combi[0],combi[1]),combi[2])

    # for a in range(1,K+1):
    #     for b in range(1,K+1):
    #         tmp=fractions.gcd(a,b)
    #         for c in range(1,K+1):
    #             sum+=fractions.gcd(tmp,c)

    print(sum)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os
import itertools

def file_input():
    f = open('Beginner_Contest_162/input.txt', 'r')
    sys.stdin = f

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

def main():
    #file_input()
    K=int(input())
    # map(int, input().split())
    sum=0

    combi_l = itertools.combinations_with_replacement(range(1,K+1),3)
    # print(combi_l)

    for combi in combi_l:
        # print(combi)
        if combi[0]==combi[1]==combi[2]:
            sum+=gcd(gcd(combi[0],combi[1]),combi[2])
        elif combi[0]==combi[1] or combi[1]==combi[2] or combi[2]==combi[0]:
            sum+=3*gcd(gcd(combi[0],combi[1]),combi[2])
        else:
            sum+=6*gcd(gcd(combi[0],combi[1]),combi[2])

    # for a in range(1,K+1):
    #     for b in range(1,K+1):
    #         tmp=fractions.gcd(a,b)
    #         for c in range(1,K+1):
    #             sum+=fractions.gcd(tmp,c)

    print(sum)

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

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

for i in range(n):
    r = 0
    tmp = a
    k = tmp[i]
    tmp.pop(i)
    
    for j in range(n-1):
        r = r + tmp[j+1:].count(tmp[j])
    print(r)
    tmp.insert(0,k)

### FIXED CODE ###

import collections

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

c = collections.Counter(a)

r = 0
for j in c:
    if c[j] > 1:
        r = int(r + (c[j] * (c[j] - 1) / 2))

tmp = r 
for i in range(n):
    r = int(r - ((c[a[i]] * (c[a[i]] - 1) / 2)) + (((c[a[i]] - 1) * (c[a[i]] - 2) / 2)))
    print(r)
    r = tmp
### BUGGY CODE ###

import math

MOD = 1000000007
MAX = 2000000010


def comb(n, r):
    return math.factorial(n) // math.factorial(n - r) // math.factorial(r)


def count_div(n):
    fact = []
    count = 0
    i = 2
    while (n != 1):
        while (n % i == 0):
            n = int(n / i)
            count += 1
        fact.append(count)
        count = 0
        i += 1
    return fact


def main():
    N, M = map(int, input().split())
    ans = 1
    fact = count_div(M)
    for i, p in enumerate(fact):
        ans *= comb(p + N - 1, p)
    return ans % MOD


print(main())

### FIXED CODE ###

MOD = 10 ** 9 + 7

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

f = []
p = 2
while p * p <= M:
    if M % p != 0:
        p += 1
        continue
    c = 0
    while M % p == 0:
        c += 1
        M //= p
    f.append(c)
    p += 1
if M != 1:
    f.append(1)

ans = 1
for i in f:
    c = 1
    for j in range(i):
        c = c * (N + j) // (j + 1)
    ans = ans * c % MOD
print(ans)
### BUGGY CODE ###

import math

k = int(input())
ans = 0

for i in range(1, k + 1):
    for j in range(1, k + 1):
        for m in range(1, k + 1):
            ans += math.gcd(math.gcd(i, j), m)
print(ans)

### FIXED CODE ###

import math
 
K = int(input())
 
lists = []
for i in range(1, K + 1):
    for j in range(1, K + 1):
        mid = math.gcd(i, j)
        for k in range(1, K + 1):
            lists.append(math.gcd(mid, k))
 
print(sum(lists))
### BUGGY CODE ###

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

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

# Add dummy data at first position
A_list = [None] + list(map(int, input().rstrip().split()))
#-----

mod = 998244353

dp = [ [0]*(S+1) for _ in range(N+1) ]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        if (j - A_list[i+1]) >=0:
            dp[i+1][j] = dp[i][j - A_list[i+1]]
        
        dp[i+1][j] += 2*dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])


### FIXED CODE ###

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

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

# Add dummy data at first position
A_list = [None] + list(map(int, input().rstrip().split()))
#-----

mod = 998244353

dp = [ [0]*(S+1) for _ in range(N+1) ]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        if (j - A_list[i+1]) >=0:
            dp[i+1][j] = dp[i][j - A_list[i+1]]
        
        dp[i+1][j] += 2*dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])
### BUGGY CODE ###

n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab.sort(key=lambda x:x[0])
ans=0
l=[]
e=0
for i in range(1,m+1):
  while e<n and ab[e][0]==i:
    l.append(ab[e][1])
    e+=1
  if len(l)>0: 
    ans+=max(l)
    l.remove(max(l))
print(ans)

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab.sort(key=lambda x:x[0])
ans=0
q=[]
heapq.heapify(q)
e=0
for i in range(1,m+1):
  while e<n and ab[e][0]==i:
    heapq.heappush(q,-ab[e][1])
    e+=1
  if len(q)>0: 
    ans-=heapq.heappop(q)
print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
l = [0 for _ in range(N)]

now = 0
l[now] = 1
count = 0

while count < K:
    count += 1
    now = A[now]-1
    if l[now] == 0:
        l[now] = 1
    else:
        break

if count == K:
    print(now + 1)
else:
    for i in range(K - count):
        now = A[now] - 1
    print(now + 1)


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
l = [0 for _ in range(N)]

now = 0
l[now] = 1
count = 0
loop = [0]

while count < K:
    count += 1
    now = A[now]-1
    loop.append(now)
    if l[now] == 1:
        loop = loop[loop.index(now):-1]
        break
    else:
        l[now] = 1

if count == K:
    print(now + 1)
else:
    ans = loop[(K-count) % len(loop)]
    print(ans + 1)
### BUGGY CODE ###

n = int(raw_input())
ls = []
l = 0
for i in range(n):
    cmd = map(str, raw_input().split())
    if cmd[0] == "insert":
        ls.insert(0, cmd[1])
        l += 1
    elif cmd[0] == "deleteFirst":
        del ls[:1]
        l -= 1
    elif cmd[0] == "deleteLast":
        del ls[l-1:]
        l -= 1
    elif cmd[0] == "delete":
        if ls.count(cmd[1]) > 0:
            ls.remove(cmd[1])
            l -= 1
print " ".join(map(str, ls))

### FIXED CODE ###

n = int(raw_input())
ls = []
bp = 0
for i in range(n):
	cmd = raw_input()
	if cmd[0] == "i":
		ls.append(cmd[7:])
	elif cmd[6] == " ":
		try:
			x = ls[::-1].index(cmd[7:])
			if x!=-1:
				del ls[-x-1]
		except:
			pass
	elif cmd[6] == "F":
		ls.pop()
	else:
		bp += 1

print " ".join(map(str, ls[bp:][::-1]))
### BUGGY CODE ###

n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [0] * (n + 10)

for i in range(n + 1):
    if i in a:
        dp[i] = 0
    elif i == 0 or i == 1:
        dp[i] = 1
    else:
        dp[i] = dp[i - 2] + dp[i - 1]

print(dp[n] % 1000000007)


### FIXED CODE ###

n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [1] * (n + 10)
for i in range(len(a)):
    dp[a[i]] = 0

for i in range(n + 1):
    if i == 0 or i == 1:
        dp[i] = dp[i] * 1
    else:
        dp[i] = dp[i] * (dp[i - 2] + dp[i - 1])

print(dp[n] % 1000000007)
### BUGGY CODE ###

# coding: utf-8
import sys
from bisect import bisect_left, bisect_right
import itertools
from heapq import heapify, heappop, heappush

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

# 二分探索, 大きい方から１つずつheapに入れる、XとYは全探索
# AとBは全探索
X, Y, Z, K = lr()
A = lr(); A.sort()
B = lr(); B.sort()
C = lr(); C.sort()
D = []
for a, b in itertools.product(A, B):
    D.append(a+b)
D.sort()

def check(x):
    length = len(D)
    count = 0
    for y in C:
        i = bisect_left(D, x-y)
        count += length - i
    return count >= K

ok = 0; ng = 10 ** 11
while abs(ng-ok) > 1:
    mid = (ok+ng) // 2
    if check(mid):
        ok = mid
    else:
        ng = mid

# ok以上の値
answer = []
for y in C:
    index = bisect_left(D, ok-y)
    for i in range(index, len(D)):
        heappush(answer, -(D[i]+y))

for i in range(K):
    print(-heappop(answer))

# 02

### FIXED CODE ###

import numpy as np
from heapq import *

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

h = []
heappush(h, (-A[0]-B[0]-C[0], 0, 0, 0))
used = set()
result = []

for _ in range(K):
    sum, i, j, k = heappop(h)
    result.append(-sum)
    if i < X-1 and (i+1, j, k) not in used:
        heappush(h, (-A[i+1]-B[j]-C[k], i+1, j, k))
        used.add((i+1, j, k))
    if j < Y-1 and (i, j+1, k) not in used:
        heappush(h, (-A[i]-B[j+1]-C[k], i, j+1, k))
        used.add((i, j+1, k))
    if k < Z-1 and (i, j, k+1) not in used:
        heappush(h, (-A[i]-B[j]-C[k+1], i, j, k+1))
        used.add((i, j, k+1))

for v in result:
    print(v)
### BUGGY CODE ###

from math import sqrt

n = int(input())

i = 2
j = 0
c = []

while n != 1:
    
    if n%i == 0:
        j += 1
        n = n/i
        if n == 1:
            c.append(j)
    else:
        if j != 0:
            c.append(j)
        i += 1
        j = 0
        
d = 0        
if c == []:
    print(d)
else:
    for k in c:
        d += int((sqrt(1 + 8*k)-1)/2)
    print(d)
            

### FIXED CODE ###

from math import sqrt

n = int(input())

i = 2

c = []

while i*i <= n:
    j = 0
    while n%i == 0:
        j += 1
        n //= i   
    else:
        if j != 0:
            c.append(j)
    i += 1
if n > 1:
    c.append(1)
             
d = 0        
if c == []:
    print(d)
else:
    for k in c:
        d += int((sqrt(1 + 8*k)-1)/2)
    print(d)
### BUGGY CODE ###

#数列の値を重複無く昇順に並べたものとその個数を別々に保存する
#配列のどこに挿入等の操作をするかは二分探索で調べる

def bs(A, key, B, keynum):
    sizeA = len(A)
    # 0なら挿入確定
    if sizeA == 0:
        A.append(key)
        B.append(keynum)
        return

    l = 0
    r = sizeA - 1
    mid = (l+r) // 2

    while r - l >= 1:
        if A[mid] == key:
            break
        elif key < A[mid]:
            r = mid
        else:
            l = mid + 1
        mid = (l+r) // 2
    #この時点で,A[mid]はkeyと等しいかkeyより大きい最小の値である(ただしkeyがAのどの要素よりも大きい時を除く)
    if A[mid] == key:
        B[mid] += keynum
    elif A[mid] < key:
        A.append(key)
        B.append(keynum)
    else:
        A.insert(mid, key)
        B.insert(mid, keynum)

a = list(map(int,input().split()))
N = a[0]
K = a[1]

syurui = []
kousuu = []
for i in range(N):
    temp = list(map(int,input().split()))
    bs(syurui, temp[0], kousuu, temp[1])

size = len(kousuu)
sum = [0 for i in range(size)]
sum[0] = kousuu[0]
for i in range(size):
    if i > 0:
        sum[i] = sum[i-1] + kousuu[i]
    if K <= sum[i]:
        print(str(syurui[i]))
        break

### FIXED CODE ###

a = list(map(int,input().split()))
N = a[0]
K = a[1]
bucket = [0 for i in range(100001)]
for i in range(N):
    temp = list(map(int,input().split()))
    bucket[temp[0]] += temp[1]
sum = 0
for i in range(100001):
    sum += bucket[i]
    if K <= sum:
        print(str(i))
        break
### BUGGY CODE ###

k,s=map(int,input().split())
ans=0
start = max(0,s-2*k)
for a in range(start,k+1):
  for b in range(start,k+1):
    for c in range(start,k+1):
      if a+b+c==s:
        ans += 1
print(ans)

### FIXED CODE ###

k,s=map(int,input().split())
upper  = min(k,s)+1
lower = max(0,s-2*k)
ans = 0
for i in range(lower,upper):
  for j in range(lower,upper):
    if 0 <= s-(i+j) <= k:
      ans += 1
print(ans)
### BUGGY CODE ###

s = input().strip()
K = int(input())
if K>len(s)*26:
    d = (K-len(s)*26)//26
    K = K-26*d
x = ""
for i in range(len(s)):
    if i<len(s)-1 and (26-(ord(s[i])-ord("a")))%26 <= K:
        x += "a"
        K -= (26-(ord(s[i])-ord("a")))%26
    elif i<len(s)-1:
        x += s[i]
    elif i==len(s)-1:
        k = ord(s[i])+K%26
        if k<=122:
            x += chr(k)
        else:
            x += chr(k-26)
print(x)

### FIXED CODE ###

s = input().strip()
K = int(input())
if K>len(s)*26:
    d = (K-len(s)*26)//26
    K = K-26*d
x = ""
for i in range(len(s)):
    if i<len(s)-1 and (26-(ord(s[i])-ord("a")))%26 <= K:
        x += "a"
        K -= (26-(ord(s[i])-ord("a")))%26
    elif i<len(s)-1:
        x += s[i]
    elif i==len(s)-1:
        k = ord(s[i])+K%26
        if k<=122:
            x += chr(k)
        else:
            x += chr(k-26)
print(x)
### BUGGY CODE ###

job = list()
salary = list()
n,m = map(int,input().split())
k = m

for i in range(n):
    job.append(tuple(map(int,input().split())))

job.sort(reverse = True)

for x in job:
    a,b = x
    salary.append(b)

    if a > k:
        salary.remove(min(salary))
    else:
        k -= 1

print(sum(salary))


### FIXED CODE ###

import heapq
job = list()
salary = list()
n,m = map(int,input().split())

for i in range(n):
    a,b = map(int,input().split())
    job.append((a,b))

job.sort(reverse = True)

for x in job:
    s,t = x
    heapq.heappush(salary,t)
    if s - m > 0:
        heapq.heappop(salary)
    else:
        m -= 1

print(sum(salary))
### BUGGY CODE ###

n,m=map(int,input().split())
A=[int(input()) for _ in range(m)]
L=[1,1]
if 1 in A:L[1]=0
for i in range(2,n+1):
    if i in A:
        L.append(0)
    else:
        L.append(L[i-2]+L[i-1])
print(L[n]%(10**9 + 7))

### FIXED CODE ###

n,m=map(int,input().split())
A={int(input()) for _ in range(m)}
dp=[1]+[0]*(n+1)
for i in range(n):
    if i in A:
        continue
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]
print(dp[n]%(10**9 + 7))
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]
cnt = [a.count(i) for i in range(1, n+1)]

for i in range(n):
    print(cnt[i])

### FIXED CODE ###

import collections
n = int(input())
a = [int(i) for i in input().split()]
cnt = collections.Counter(a)

for i in range(1, n+1):
    print(cnt[i])
### BUGGY CODE ###

import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s=[[],[],[],[],[],[],[],[],[],[]]
sum=0
for i in range(x):
    si=ns()
    sn=len(si)-1
    if si not in s[sn]:
        s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

### FIXED CODE ###

import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    if len(si)==1:
        sn2=0
    else:
        sn2 = ord(si[1:2]) - 97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)
### BUGGY CODE ###

N = int(input())
L = list(map(int, input().split()))
L.sort()
L.reverse()
C = 0

for i in range(N-2):
	for j in range(i+1, N-1):
		K = L[j+1::]
		K = list(filter(lambda x:x>(L[i]-L[j]), K))
		C += len(K)
				
print(C)


### FIXED CODE ###

from bisect import bisect
from bisect import bisect_left

_ = input()
l = input()
l = sorted(list(map(int, l.split())))
count = 0

for i in range(len(l)):
	for j in range(i+1, len(l)):
		c = l[i]+l[j]
		count += bisect_left(l,c) - (j+1)

print(count)