Harryxun/stf_run huggingface dataset:
#D
import sys
from collections import deque
n,k=map(int,input().split())
s=input()
if n==1:
    print(1)
    sys.exit()
a=deque([])
if s[0]=="1":
    a.append([0])
for i in range(1,n):
    if s[i-1:i+1]=="01":
        a.append([i])
    elif s[i-1:i+1]=="10":
        a[-1].append(i-1)
if s[n-1]=="1":
    a[-1].append(n-1)

if a[0][0]!="0":
    a.appendleft([0,0])
if a[-1][1]!="n-1":
    a.append([n-1,n-1])

if len(a)-1<=k:
    print(n)
else:
    t=0
    for i in range(len(a)-k):
        t=max(t,a[i+k][1]-a[i][0]+1)
    print(t)

### FIXED CODE ###

#D
from collections import deque
n,k=map(int,input().split())
s=input()
if n==1:
    print(1)
elif "1" not in s:
  	print(len(s))
else:
    a=deque([])
    if s[0]=="1":
        a.append([0])
    for i in range(1,n):
        if s[i-1:i+1]=="01":
            a.append([i])
        elif s[i-1:i+1]=="10":
            a[-1].append(i-1)
    if s[n-1]=="1":
        a[-1].append(n-1)
    if a[0][0]!=0:
        a.appendleft([0,0])
    if a[-1][1]!=n-1:
        a.append([n-1,n-1])
    if len(a)-1<=k:
        print(n)
    else:
        t=0
        for i in range(len(a)-k):
            t=max(t,a[i+k][1]-a[i][0]+1)
        print(t)
import sys
input = sys.stdin.readline

def main():
    x = int(input())
    p = [0, 1]
    n = [0, -1]
    i = 2
    while p[-1] <= 2*x:
        p.append(pow(i, 5))
        n.append(-pow(i, 5))
        i += 1

    p_ = set(p)
    n_ = set(n)
    for z in p:
        if x - z in n_:
            print(int(pow(x - z, 1 / 5)), int(pow(z, 1 / 5)))
            return

        if x - z in p_:
            print(int(pow(x - z, 1 / 5)), int(-pow(z, 1 / 5)))
            return

main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    x = int(input())
    p = [0, 1]
    i = 2
    while p[-1] <= x*x:
        p.append(pow(i, 5))
        i += 1

    p_ = set(p)
    for z in p:
        if z - x in p_:
            print(int(pow(z, 1/5)), int(pow(z-x, 1/5)))
            return

        if x - z in p_:
            print(int(pow(abs(x-z), 1/5)), int(-pow(z, 1/5)))
            return


main()
#!/usr/bin/python

array = []

for i in range(10):
  array[i] = raw_input()

for j in range(3):
  print max(array) + "\n"
  array.remove(max(array))

### FIXED CODE ###

import sys

array = [0 for i in range(10)]

for i in range(10):
  array[i] = int(raw_input())

array.sort()
array.reverse()

for j in range(3):
  print str(array[j])

sys.exit()
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    x = [None] * N
    y = [None] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())
    
    diff = []
    nums = []
    for i in range(N):
        for j in range(i+1,N):
            if (x[j]-x[i],y[j]-y[i]) in diff:
                nums[diff.index((x[j]-x[i],y[j]-y[i]))] += 1
            else:
                diff.append((x[j]-x[i],y[j]-y[i]))
                nums.append(1)
    # print(diff)
    # print(nums)
    print(N-max(nums))
    
    

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
def main():
    N = int(input())
    if N == 1:print(1);exit();
    x = [None] * N
    y = [None] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())
    
    diff = []
    nums = []
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            if (x[j]-x[i],y[j]-y[i]) in diff:
                nums[diff.index((x[j]-x[i],y[j]-y[i]))] += 1
            else:
                diff.append((x[j]-x[i],y[j]-y[i]))
                nums.append(1)
    # print(diff)
    # print(nums)
    print(N-max(nums))

if __name__ == "__main__":
    main()
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
# my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    k,=pin()
    ans=0
    for i in range(1,k+1):
        if i%3!=0 and i%5!=0:
            ans+=i
    print(ans)
    
    
"""         
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じ,るの忘れてるだろ
"""
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """15"""
        output = """60"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1000000"""
        output = """266666333332"""
        self.assertIO(input, output)


if __name__ == "__main__":
   　resolve()


### FIXED CODE ###

# coding: utf-8
# Your code here!

# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
# my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    k,=pin()
    ans=0
    for i in range(1,k+1):
        if i%3!=0 and i%5!=0:
            ans+=i
    print(ans)
    
    
"""         
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じ,るの忘れてるだろ
"""
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """15"""
        output = """60"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1000000"""
        output = """266666333332"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()
s_a=list(input())
s_b=list(input())
s_c=list(input())

tmp =''
tmp=s_a.pop(0)
while 1:
    if tmp=='a':
        if s_a:
            tmp=s_a.pop(0)
        else:
            print('A')
            break
    elif tmp=='b':
        if s_b:
            tmp=s_b.pop(0)
        else:
            print('B')
            break
    else tmp=='c':
        if s_c:
            tmp=s_c.pop(0)
        else:
            print('C')
            break


### FIXED CODE ###

s_a=list(input())
s_b=list(input())
s_c=list(input())

tmp =''
tmp=s_a.pop(0)
while 1:
    if tmp=='a':
        if s_a:
            tmp=s_a.pop(0)
        else:
            print('A')
            break
    elif tmp=='b':
        if s_b:
            tmp=s_b.pop(0)
        else:
            print('B')
            break
    elif tmp=='c':
        if s_c:
            tmp=s_c.pop(0)
        else:
            print('C')
            break
from functools import reduce
import math
import itertools

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N,M = (int(_) for _ in input().split())
    a = []
    b = []
    for i in range(N):
        c, d = (int(_) for _ in input().split())
        a.append(c)
        b.append(d)
    l = list(_ for _ in range(2,N+1))
    d = []
    for elem in itertools.permutations(l,len(l)):
        elem = list(elem)
        elem.insert(0,1)
        d.append(elem)
    ans = 0
    for l1 in d:
        flag = True
        for i in range(len(l1)-1):
            for j in range(M):
                if(a[j]==l1[i] and b[j] ==l1[i+1]) or (b[j]==l1[i] and a[j] ==l1[i+1]):
                    flag = True
                    break
                flag = False
            if flag == False:
                break
        if flag:
            ans += 1

    print(ans)
if __name__ == '__main__':
    main()


### FIXED CODE ###

from functools import reduce
import math
import itertools

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N,M = (int(_) for _ in input().split())
    a = []
    b = []
    for i in range(M):
        c, d = (int(_) for _ in input().split())
        a.append(c)
        b.append(d)
    l = list(_ for _ in range(2,N+1))
    d = []
    for elem in itertools.permutations(l,len(l)):
        elem = list(elem)
        elem.insert(0,1)
        d.append(elem)
    ans = 0
    for l1 in d:
        flag = True
        for i in range(len(l1)-1):
            for j in range(M):
                if(a[j]==l1[i] and b[j] ==l1[i+1]) or (b[j]==l1[i] and a[j] ==l1[i+1]):
                    flag = True
                    break
                flag = False
            if flag == False:
                break
        if flag:
            ans += 1

    print(ans)
if __name__ == '__main__':
    main()
a, b = map(int, input().split())
c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c-1 // a-1))

### FIXED CODE ###

a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))
N = int(input())
if N == 1:
  print("Hello World")
else:
  A, B = map(int, input().split())
  print(A + B)


### FIXED CODE ###

N = int(input())
if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A + B)
S = input()
T = input()

if S == T[:-2]
	print("Yes")
else:
    print("No")


### FIXED CODE ###

S = input()
T = input()

if S == T[:-1]:
	print("Yes")
else:
    print("No")
import math
input = sys.stdin.readline

N = int(input())
lis_all = []
lis_pat = []
lis_num = []

count = 0
for i in range(N):
    lis_S = list(str(input()))
    lis_S.sort()
    if lis_S not in lis_all:
        lis_pat.append(lis_S)
    lis_all.append(lis_S)

ans = 0
for i in lis_pat:
    lis_num.append(lis_all.count(i))
    if lis_all.count(i) != 1:
        ans += math.factorial(lis_all.count(i))/2        
   
print(int(ans))

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
N=int(input())
dic={}
sum=0
for i in range(N):
    s=list(input())
    s.sort()
    s = "".join(s)
    if s in dic:
        sum+=dic[s]
        dic[s]+=1
    else:
        dic[s]=1
print(sum)
from collections import Counter

n,k = map(int, input().split())
a = input().split()
c = Counter(a)
t = len(c) - k
r = 0

if t > 0:
    serial = c.most_common[-t:]
    for s in serial:
        r += s[1]

print(r)

### FIXED CODE ###

from collections import Counter

n,k = map(int, input().split())
a = input().split()
c = Counter(a)
t = len(c) - k
r = 0

if t > 0:
    serial = c.most_common()[-t:]
    for s in serial:
        r += s[1]

print(r)
N = int(input())
K = int(input())
ls = sorted([int(i) for i in input().split(' ')], reverse=True)

l_sum = 0
for k in range(K):
    l = ls[k]
    l_sum += l

print(l_sum)

### FIXED CODE ###

data = [int(i) for i in input().split(' ')]
K = data[1]
ls = sorted([int(i) for i in input().split(' ')], reverse=True)

l_sum = 0
for k in range(K):
    l = ls[k]
    l_sum += l

print(l_sum)
def calc_sum_digits(n):
    sumd = 0
    while(n > 1):
        sumd += int(n%10)
        n /= 10
        
    return sumd

N = int(input())
sumd = 0

sumd = calc_sum_digits(N)
if(N%sumd == 0): print('yes')
else: print('No')

### FIXED CODE ###

def calc_sum_digits(n):
    sumd = 0
    while(int(n) > 0):
        sumd += int(n%10)
        n /= 10
    return sumd

N = int(input())
sumd = calc_sum_digits(N)
if(N%sumd == 0):
     print('Yes')
else:
     print('No')
str1, str2 = input().split()
cnt1, cnt2 = list(map(int, input().split()))
tar = input()

if tar == str1:
  cnt1 -= 1
else
  cnt2 -= 1

print(str(cnt1) + " " + str(cnt2))

### FIXED CODE ###

str1, str2 = input().split()
cnt1, cnt2 = list(map(int, input().split()))
tar = input()

if tar == str1:
  cnt1 -= 1
else:
  cnt2 -= 1

print(str(cnt1) + " " + str(cnt2))
N,P = map(int,input().split())
S=input()
mem_mod = [0 for i in range(0,2019,1)]
counter = 0
S_num = list(map(int, S))
tmp=10

for i in range(1,N,1):
    S_num[N-i-1] = S_num[N-i] + S_num[N-i-1]*pow(10,i,P)

for i in range(0,N,1):
    X = S_num[N-i-1] % P
    if X==0:
        counter+=1
    counter += mem_mod[X]
    mem_mod[X] += 1
print(counter)

### FIXED CODE ###

import sys

N, P = map(int, input().split())
A = input()

ans = 0

if 10 % P == 0:
    for r in range(len(A)):
        if int(A[r]) % P == 0:
            ans += r + 1
    print(ans)
    sys.exit()


A = "0" + A[::-1]

S = [0] * len(A)
cnt = [0] * P
cnt[0] = 1

for i in range(len(A) - 1):
    S[i + 1] = (S[i] + int(A[i + 1]) * pow(10, i, P)) % P
    cnt[S[i + 1] % P] += 1
# print(S, cnt)

# ans = cnt[0] * (cnt[0] - 1) // 2
for c in cnt:
    ans += c * (c - 1) // 2
print(ans)
L = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]

N, M = map(int, input().split())
A = [int(a) for a in input().split()]
B = [(A[i], L[A[i]]) for i in range(M)]

X = [0] + ([-1] * N)
for i in range(1, N+1):
  for b in B:
    X[i] = max(X[i], X[i-b[1]] * 10 + b[0])

print(X[N])


### FIXED CODE ###

L = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]

N, M = map(int, input().split())
A = [int(a) for a in input().split()]
B = [(A[i], L[A[i]]) for i in range(M)]

X = [0] + ([-1] * N)
for i in range(1, N+1):
  for b in B:
    if b[1] <= i:
      X[i] = max(X[i], X[i-b[1]] * 10 + b[0])

print(X[N])
N,Ma,Mb = map(int,input().split())
first_half = []
last_half = []
for i in range(N):
	a,b,c = map(int,input().split())
	if i < N // 2:
		first_half.append((a,b,c))
	else:
		last_half.append((a,b,c))

first_half_combination = {}
last_half_combination = {}
def make_all_combination(i,a,b,c,d_list,flag):
	if i == len(d_list) and c > 0:
		w = Ma * b - Mb * a
		if flag:
			if w not in first_half_combination or c < first_half_combination[w]:
				first_half_combination[w] = c
		else:
			if -w not in last_half_combination or c < last_half_combination[-w]:
				last_half_combination[-w] = c
		return
	make_all_combination(i+1,a,b,c,d_list,flag)
	make_all_combination(i+1,a+d_list[i][0],b+d_list[i][1],c+d_list[i][2],d_list,flag)

def search(w, lst):
	left,right = 0, len(lst)
	while left + 1 != right:
		p = (left + right) // 2
		if lst[p][0] < w:
			left = p
		else:
			right = p
	return left
make_all_combination(0,0,0,0,first_half,True)
make_all_combination(0,0,0,0,last_half,False)

print(first_half_combination)
print(last_half_combination)
ans = -1
for w in first_half_combination.keys():
	if w in last_half_combination:
		cost = first_half_combination[w] + last_half_combination[w]
		if w == 0:
			cost = min(first_half_combination[w], last_half_combination[w])
		if ans == -1 or cost < ans:
			ans = cost
	elif w == 0:
		cost = first_half_combination[w]
		if cost < ans:
			ans = cost
print(ans)

### FIXED CODE ###

N,Ma,Mb = map(int,input().split())
first_half = []
last_half = []
for i in range(N):
	a,b,c = map(int,input().split())
	if i < N // 2:
		first_half.append((a,b,c))
	else:
		last_half.append((a,b,c))

first_half_combination = {}
last_half_combination = {}
def make_all_combination(i,a,b,c,d_list,flag):
	if i == len(d_list):
		if c == 0:
			return

		w = Ma * b - Mb * a
		if flag:
			if w not in first_half_combination or c < first_half_combination[w]:
				first_half_combination[w] = c
		else:
			if -w not in last_half_combination or c < last_half_combination[-w]:
				last_half_combination[-w] = c
		return
	make_all_combination(i+1,a,b,c,d_list,flag)
	make_all_combination(i+1,a+d_list[i][0],b+d_list[i][1],c+d_list[i][2],d_list,flag)

make_all_combination(0,0,0,0,first_half,True)
make_all_combination(0,0,0,0,last_half,False)

INF = 10**8
f_0 = first_half_combination[0] if 0 in first_half_combination else INF
l_0 = last_half_combination[0] if 0 in last_half_combination else INF
ans = min(f_0,l_0) if min(f_0,l_0) < INF else -1
for w in first_half_combination.keys():
	if w == 0:
		continue
	if w in last_half_combination:
		cost = first_half_combination[w] + last_half_combination[w]
		if w == 0:
			cost = min(first_half_combination[w], last_half_combination[w])
		if ans == -1 or cost < ans:
			ans = cost
print(ans)
n=int(input())
x=list(int(input().split())
 
ans = 1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans = -1
print(ans)


### FIXED CODE ###

n=int(input())
x=list(map(int, input().split()))
 
ans=1
if 0 in x:
  ans=0
else:
  for i in x:
    ans=ans*i
    if ans>10**18:
      ans=-1
      break
print(ans)
L,N = (int, input().split())
s = sorted([input() for i in range(N)])
print("".join(s))

### FIXED CODE ###

n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print("".join(s))
from math import gcd

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

g_max = 0
for i in range(n-1):
    g = gcd(a[i], a[i+1])
    if g > g_max:
        g_max = g
if n == 3:
    g = gcd(a[0], a[2])
    if g > g_max:
        g_max = g

print(g_max)


### FIXED CODE ###

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

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

g_max = -1
l = [0] * n
r = [0] * n
for i in range(n):
    if i == 0:
        l[0] = 0
    else:
        l[i] = gcd(l[i-1], a[i-1])

for i in range(n-1,-1,-1):
    if i == n-1:
        r[i] = 0
    else:
        r[i] = gcd(r[i+1], a[i+1])

g_max = -1
for i in range(n):
    g = gcd(l[i], r[i])
    if g > g_max:
        g_max = g

print(g_max)
k = int(input())
    s = str(input())
    if len(s) <= k:
        print(s)
    else:
        print(s[:k])

### FIXED CODE ###

k = int(input())
s = input()
if k >= len(s):
  print(s)
else:
  print(s[:k]+"...")
def f(x):
    if dp[x] != -1:
        return dp[x]

    t = 0
    for v in V[x]:
        t = max(t, f(v)+1)

    dp[x] = t
    return t

n, m = map(int, input().split())

dp = [-1]*(n+1)
V = [[] for _ in range(n+1)]

for _ in range(m):
    x, y = map(int, input().split())
    V[x].append(y)

t = 0
for i in range(1, n+1):
    t = max(t, f(i))

print(t)


### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

n, m = map(int, input().split())

dp = [-1 for _ in range(n)]
V = [[] for _ in range(n)]

for _ in range(m):
    x, y = map(int, input().split())
    V[x-1].append(y-1)

def f(x):
    if dp[x] != -1:
        return dp[x]

    t = 0
    for v in V[x]:
        t = max(t, f(v)+1)

    dp[x] = t
    return dp[x]

t = 0
for i in range(n):
    t = max(t, f(i))

print(t)
A = sorted(list(input()))
T = sorted(list(input()))

ans = 'Yes'

for i in range(len(A)):
  if A[i] != T[i]:
    ans = "No'
    
print(ans)

### FIXED CODE ###

A = list(input())
T = str(input())

check = 'No'

for i in range(len(A)):
  if ''.join(A) == T:
    check = 'Yes'
  A.insert(0, A.pop(-1))

print(check)
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
n, k = map(int, input().split())
a = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

homon = [-1] * (n + 1)

current = 0
for i in range(n): 
    if homon[current] == -1:
        homon[current] = i
        current = a[current] - 1
    else:
        #print(current)
        break

#print(homon)
nitta = len([t for t in homon if t != -1])
nltn = current
nlty = 1 if (diff := nitta - nltn) == 0 else diff

if k < nltn:
    print(current + 1)
else:
    k -= nltn
    k %= nlty
    print(homon.index(k) + 1)



### FIXED CODE ###

#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
n, k = map(int, input().split())
a = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

ord_ = [-1] * (n + 1)
s = []
v = 1
while ord_[v] == -1:
    ord_[v] = len(s)
    s.append(v)
    v = a[v-1]
c = len(s) - ord_[v]
l = ord_[v]

if k < l:
    print(s[k])
else:
    k -= l
    k %= c
    print(s[l+k])
n=int(input())
L=list(map(int, input().split()))
L.sort()
count = 0
for a in range(n-2):
  for b in range(a+1,n-1):
    count += bisect_left(L, L[a]+L[b]) - b - 1

print(count)

### FIXED CODE ###

n=int(input())
L=list(map(int, input().split()))
L.sort()
count = 0
for a in range(n-2):
  for b in range(a+1,n-1):
    if L[a] + L[b] > L[n-1]:
      count += n - b - 1
      continue
    left = b + 1
    right = n - 1
    while right - left > 0:
      c = (left+right) // 2
      if L[c] < L[a] + L[b]:
        left = c + 1
      else:
        right = c
    count += left - b - 1
print(count)
s = open(0).read().split()
x = s[0][0]
s[0] = s[0][1:]
 
while True:
  p = ord(x)-97
  if len(s[p] == 0):
    print(ord(x).upper())
    break
  x = s[p][0]
  s[p] = s[p][1:]

### FIXED CODE ###

s = open(0).read().split()
x = s[0][0]
s[0] = s[0][1:]
 
while True:
  p = ord(x)-97
  if len(s[p]) == 0:
    print(x.upper())
    break
  x = s[p][0]
  s[p] = s[p][1:]
N, A = map(int, input().split())
print(0 if X < A else 10)

### FIXED CODE ###

X, A = map(int, input().split())
print(0 if X < A else 10)