Harryxun/stf_run huggingface dataset:
s = list(input())
k_index = []
k = list('keyence')

for i in range(len(s)):
    if s[i] == k[0]:
        k_index.append(i)

ans = 'NO'
for i in k_index:
    j = 0
    flag = 0
    for a in s[i:]:
        if a == k[j]:
            j += 1
            if flag == 0:
                flag = 1 # reading 1st half
            elif flag == 2:
                flag = 3 # reading 2nd half
            if j == len(k):
                ans = 'YES'
        elif flag == 1: # end of 1st half
            flag = 2 # reading middle
        elif flag == 3:
            break

print(ans)

### FIXED CODE ###

s = input()
k = 'keyence'

for i in range(len(s)):
    for j in range(i,len(s)):
        if s[:(i+1)]+s[j:] == 'keyence':
            print('YES')
            exit()

print('NO')
import sys
input = sys.stdin.readline

N,K,Q=map(int, input().split())

import numpy as np
p=np.zeros(N).astype(int)+K

for i in range(Q):
  j=int(input())-1
  p[j]=p[j]+1
  p=p-1
  
for i in range(N):
  if p[i]<1:
    print('No')
  else:
    print('Yes')

### FIXED CODE ###

import sys
input = sys.stdin.readline

N,K,Q=map(int, input().split())

p=[-Q]*N

for i in range(Q):
  j=int(input())-1
  p[j]=p[j]+1

for i in range(N):
  if p[i]+K<1:
    print('No')
  else:
    print('Yes')
ondo = input()
if ondo >= 30:
  print("Yes")
else:
  print("No")


### FIXED CODE ###


ondo = input()
if int(ondo) >= 30:
  print("Yes")
else:
  print("No")
n = int(input())
m = int(input())

n_dot = n*(n-1)/2
m_dot = m*(m-1)/2

answer = n_dot+ m_dot
print(answer)

### FIXED CODE ###

n,m=(int(x) for x in input().split())

n_dot = n*(n-1)/2
m_dot = m*(m-1)/2

answer = int(n_dot+ m_dot)
print(answer)
n=int(input())
a=list(map(int,input().split()))
ans=0
b=sorted(a)
for i in range(n):
  if b[i]==b[i+1]:
    ans=1
    break
if ans==1:
  print('NO')
else:
  print('YES')


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
b=sorted(a)
for i in range(n-1):
  if b[i]==b[i+1]:
    ans=1
    break
if ans==1:
  print('NO')
else:
  print('YES')
import collections from deque
dq = deque()

for i in range(int(input())):
    order = imput().split()

    if com[0] == 'insert':
        dq.appendleft(com[1])
    elif com[0] == 'deleteFirst':
        dq.popleft()
    elif com[0] == 'deleteLast':
        dq.pop()
    else:
        if com[1] in dq:
            dq.remove(com[1])

print(' '.join(dq))

### FIXED CODE ###

from collections import deque
import sys

dq = deque()
num = int(sys.stdin.readline())
line = sys.stdin.readlines()

for i in range(num):

    order = line[i].split()

    if order[0] == 'insert':
        dq.appendleft(order[1])
    elif order[0] == 'deleteFirst':
        dq.popleft()
    elif order[0] == 'deleteLast':
        dq.pop()
    else:
        if order[1] in dq:
            dq.remove(order[1])

print(' '.join(dq))
#XY = [[1,2],[1,1],[2,2],[2,1],[3,1],[3,2]]
#N = len(XY)
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0]/2)
print(N-d)

### FIXED CODE ###

N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
if N==1:
    print(1)
    exit()
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0])
print(N-d)
N =int(input())
i = 0

while True:
  i += N % 10
  i = i % 9
  N = int(N/10)
  if N == 0:
    break

if i % 9 == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N =input()
array = list(map(int, N))

if sum(array) % 9 == 0:
  print("Yes")
else:
  print("No")
N, K = map(int, input().split())
H=[int(input()) for i in range(N)]

H.sort()

ans = float("inf")
for i in range(N-K+1):
    ans = min(ans, H[i+N-K]-H[i])

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
H=[int(input()) for i in range(N)]

H.sort()

ans = float("inf")
for i in range(N-K+1):
    ans = min(ans, H[K-N+i-1]-H[i])

print(ans)
N,A,B=map(int,input().split())

cnt_blue = 0

pre_loop_cnt = N // (A+B)
totol_pre_A = sum([A] * pre_loop_cnt)
totol_pre_B = sum([B] * pre_loop_cnt)

total_tmp = totol_pre_A + totol_pre_B
total_tmp += A
if N <= total_tmp:
    cnt_blue = N -  totol_pre_B
else:
    cnt_blue = totol_pre_A + A

### FIXED CODE ###

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

cnt_blue = 0
total_tmp = 0

try:
    pre_cnt = N // (A+B)
    total_tmp = pre_cnt * (A+B)
    total_tmp += A
    if N <= total_tmp:
        cnt_blue = N -  (pre_cnt * B)
    else:
        cnt_blue = (pre_cnt * A) + A
    print(cnt_blue)
except Exception as e:
    print(0)
n = int(input())
D = [input() for i in range(n)]
print(len(set(D)))

### FIXED CODE ###

print(input().replace('2017','2018'))
n=int(input())

e=[0 for i in range(n)]
for i in range(2,n):
  for j in range(2,i):
    if i==1:
      break
    while i%j==0:
      i//=j
      e[j]+=1

def num(k):
  ret=0
  for i in range(n):
    if e[i]>=k:
      ret += 1
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

### FIXED CODE ###

n=int(input())
e=[0 for i in range(n+1)]
for i in range(2,n+1):
  for j in range(2,i+1):
    if i==1:
      break
    while i%j==0:
      i//=j
      e[j]+=1

def num(k):
  ret=0
  for i in range(n):
    if e[i]>=k-1:
      ret += 1
  return ret
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)
mport queue

k = int(input())
q = queue.Queue()
for i in range(1,9):
  q.put(i)

n = 0
while True:
  val = q.get()
  if val % 10 != 0:
    q.put(10 * val + (val % 10) - 1)
  q.put(10 * val + (val % 10))
  if val % 10 != 9:
    q.put(10 * val + (val % 10) + 1)
  
  n += 1
  if n == k:
    print(val)
    break

### FIXED CODE ###

import queue

k = int(input())
q = queue.Queue()
for i in range(1,10):
  q.put(i)

n = 0
while True:
  val = q.get()
  n += 1
  if n == k:
    print(val)
    break

  if val % 10 != 0:
    q.put(10 * val + (val % 10) - 1)
  q.put(10 * val + (val % 10))
  if val % 10 != 9:
    q.put(10 * val + (val % 10) + 1)
A = []
for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

bingo = []
for t in range(N):
    for i in range(3):
        if b[t] in A[i]:
            j = A[i].index(b[t])
            #bingo.append((i, j))
            A[i][j] = True

for i in range(3):
    if A[i][0] == A[i][1] == A[i][2]:
        answer = "Yes"

for j in range(3):
    if A[0][j] == A[1][j] == A[2][j]:
        answer = "Yes"
if A[0][0] == A[1][1] == A[2][2]:
    answer = "Yes"

if A[2][0] == A[1][1] == A[0][2]:
    answer = "Yes"
    

print(answer)

### FIXED CODE ###

A = []
for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

bingo = []
for t in range(N):
    for i in range(3):
        if b[t] in A[i]:
            j = A[i].index(b[t])
            #bingo.append((i, j))
            A[i][j] = True

answer = "No"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2]:
        answer = "Yes"

for j in range(3):
    if A[0][j] == A[1][j] == A[2][j]:
        answer = "Yes"
if A[0][0] == A[1][1] == A[2][2]:
    answer = "Yes"

if A[2][0] == A[1][1] == A[0][2]:
    answer = "Yes"
    

print(answer)
import collections

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

b = a[::2]
c = a[1::2]

b_ =collections.Counter(b)
c_ =collections.Counter(c)

baa = b_.most_common(b_)
caa = c_.most_common(c_)

baa.append([0,0])
caa.append([0,0])

if baa[0][0] != caa[0][0]:
    print(N - baa[0][1] - caa[0][1])
else:
    print(max(N - baa[0][1] - caa[1][1],N - caa[0][1] - baa[1][1]))

### FIXED CODE ###

import collections

N = int(input())
a = list(int(i) for i in input().split())

b = a[::2]
c = a[1::2]

b_ =collections.Counter(b)
c_ =collections.Counter(c)

baa = b_.most_common()
caa = c_.most_common()

baa.append([0,0])
caa.append([0,0])

if baa[0][0] != caa[0][0]:
    print(N - baa[0][1] - caa[0][1])
else:
    print(min(N - baa[0][1] - caa[1][1],N - caa[0][1] - baa[1][1]))
N = int(input())
P = list(map(int,input().split()))
A = []
for i in range(N-1):
    if P[i]>P[i+1]:
        A.append([(P[i],i),(P[i+1],i+1)])
l = len(A)
if l > 2:
    print("NO")
elif l ==1:
    print("NO")
elif l == 0:
    print("YES")
else:
    a = max(A[0])
    b = min(A[1])
    P[a[1]],P[b[1]] = b[0],a[0]
    #print(P)
    for j in range(N-1):
        if P[j] > P[j+1]:
            print("NO")
            break
    if j == N-2:
        print("YES")

### FIXED CODE ###

A,B = map(int,input().split())
C = A+B
if C%2 ==0:
    K = int(C/2)
elif A-B ==0:
    K = 0
else:
    K = "IMPOSSIBLE"
print(K)
seq_a = []
seq_b = []
seq_n = int(input())
for i in range(seq_n):
    num_a,num_b=map(int,input().split())
    a.append(num_a)
    b.append(num_b)
x = 0
for i in range(seq_n - 1, -1 ,-1):
    elem_a , elem_b = seq_a[i],seq_b[i]
    y = (elem_a + x)% elem_b
    if y != 0: x += (m-y)
print(x)

### FIXED CODE ###

a=[]
b=[]
n=int(input())
for i in range(n):
    j,k=map(int,input().split())
    a.append(j)
    b.append(k)
x=0
for i in range(n-1,-1,-1):
    n,m=a[i],b[i]
    y=(n+x)%m
    if y!=0:x+=m-y
print(x)
import heapq


N = int(input())
h = [int(i) for i in input().split()]
i = 1
dp = [0 for i in range(N)]
K = 2
 
while not i==N:
    l = min(K,i)
    data = []
    for j in range(1,l+1):
        heapq.heappush(data, dp[i-j]+abs(h[i] - h[i-j]))
    dp[i] = heapq.heappop(data)
    i+=1
    
print(dp[N-1])

### FIXED CODE ###

def test():
    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):
        dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))
 
    print(dp[-1])
 
if __name__ == '__main__':
    test()
a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)

### FIXED CODE ###

a = int(input())
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

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

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

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7

LCM=lcm_list(A)
ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)

### FIXED CODE ###

import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


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

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

for i in range(N):
    ans+=(LCM//A[i])


print(ans%MOD)
n,d,m,t,ans=int(input()),list(map(int,input().split())),int(input()),list(map(int,input().split())),"YES"
dn,tn,dc,tc=[],[],[],[]
for i in d:
  if i in dn:dc[dn.index(i)]+=1
  else:dn.append(i);dc.append(1)
for i in t:
  if i in tn:tc[tn.index(i)]+=1
  else:tn.append(i);tc.append(1)
for i in range(len(tn)):
  if tc[i]>dc[dn.index(tn[i])]:ans="NO"
print(ans)

### FIXED CODE ###

from collections import Counter
n,d,m,t,ans=int(input()),Counter(map(int,input().split())),int(input()),Counter(map(int,input().split())),"YES"
for i in t.keys():
  if i in d.keys():
    if d[i]<t[i]:ans="NO"
  else:ans="NO"
print(ans)
n,k = map(int,input().split())
li = list(map(int,input().split()))

start = 0
atesaki = 0
atesaki_li = [0]
target = atesaki
last = -1
for i in range(k):
    atesaki = li[start]-1
    start = atesaki
    if atesaki in atesaki_li:
        last = atesaki
        break
    else:
        atesaki_li.append(atesaki)
#print(last,atesaki_li)
#[0, 2, 3]

ma = len(atesaki_li)
if k+1<=ma:
    print(ma[k])
else:
    fi = atesaki_li.index(last)
    kurikaeshi = ma - fi
    ama = (k+1-ma)%kurikaeshi
    #print(fi,ama,atesaki_li)
    print(atesaki_li[(fi-1)+ama]+1)

### FIXED CODE ###

n,k = map(int,input().split())
li = [0]+list(map(int,input().split()))

memo = [-1]*(n+1)
start = 1
syuuki = 0
haji = 0

for i in range(k):
    if memo[start] != -1:
        syuuki = i - memo[start]
        haji = memo[start]
        break
    memo[start] = i
    start = li[start]
else:
    print(start)
    exit()

#print(syuuki,haji)
k-=haji
k%=syuuki
k+=haji

start = 1
for kk in range(k):
    start = li[start]
print(start)
N = int(input())
s = input()
 
r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')

ans = r_cnt * g_cnt * b_cnt
 
for i in range(N):
    for j in range(i,N):
        k = 2*j - i
        if k >= N:
            break
        elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans -= 1

print(ans)

### FIXED CODE ###

N = int(input())
S = input()
 
r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt * g_cnt * b_cnt
 
for i in range(N):
    for j in range(i,N):
        k = 2*j - i
        if k >= N:
            break
        if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans -= 1
#         print(i,j,k)

print(ans)
import numpy as np
from numba import jit
  
data = np.array(input().split(" "), dtype="int")
life = np.array(input().split(" "), dtype="int")
@jit
def calculation(data, life):
    monsters = data[0]
    smash = data[1]
    a = np.sort(life)
    if smash >= len(a):
        print(0)
    elif smash == 0:
        print(np.sum(a))
    else:
        leftover = np.where(a[-smash] > a, a, 0)
        print(np.sum(leftover))

calculation(data, life)

### FIXED CODE ###

import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()
n = int(input())
if n < 10:
  print(n)
  exit()
if n >= 10 and n < 100:
  print(9)
  exit()
if n >= 100 and n < 1000:
  #print(9 + (int(str(n)[-2:])) + 1)
  print(9 + (n-100) + 1)
  exit()
if n >= 1000 and n < 10000:
  print(909)
  exit()
if n >= 10000 and n < 100000:
  print(909 + (n-10000) + 1)
  exit
if n == 100000:
  print(90909)


### FIXED CODE ###

a, b, c = map(int,input().split())
ans = c-(a-b)
if ans < 0:
  ans = 0
print(ans)
sum = 0
while 1:
   x = raw_input()
   sum = sum + 1
   if x == '0':
      break
   print 'Case %s: %s' %(i, x)

### FIXED CODE ###

sum = 0
while 1:
   x = raw_input()
   sum = sum + 1
   if x == '0':
      break
   print 'Case %s: %s' %(sum, x)
a, b, t = input().split() 
print(t / a * b)

### FIXED CODE ###

a, b, t = input().split() 
print(int(t) // int(a) * int(b))
N=input()
if "7" in N:
  print("Yes")
else:
  print("No)

### FIXED CODE ###

N=str(input())
if "7" in N:
  print("Yes")
else:
  print("No")
import numpy as np
N,H=map(int,input().split())
ab=[input().split() for i in range(N)]
a = [int(ab[i][0]) for i in range(N)]
maxa = max(a)
b = np.array([int(ab[i][1]) for i in range(N)])
b_effective = b[b > maxa]
b = np.sort(b_effective)[::-1]
s = 0
i = 0
while s < Y and i < len(b):
 s += b[i]
 i += 1
rest = H-sum(b_effective)
if rest % maxa == 0:
 d = rest//maxa
else:
 d = rest//maxa + 1
print(i+d)


### FIXED CODE ###

import numpy as np
N,H=map(int,input().split())
ab=[input().split() for i in range(N)]
a = [int(ab[i][0]) for i in range(N)]
maxa = max(a)
b = np.array([int(ab[i][1]) for i in range(N)])
b_effective = b[b > maxa]
d = 0
if sum(b_effective) < H:
    c = len(b_effective)
    rest = H - sum(b_effective)
    if rest % maxa == 0:
        d = rest//maxa
    else:
        d = rest//maxa + 1
else:
    b = np.sort(b_effective)[::-1]
    s = 0
    for i in range(len(b)):
        s += b[i]
        if s >= H:
            c = i + 1
            d = 0
            break
print(c+d)
N = input()
L = len(N)
K = int(input())
if L < K:
    print(0)
else:

    def main(d, k):
        if N[d] == "0":
            return main(d + 1, k)
        if (L - d) < k:
            return 0
        if k == 1:
            return ((L - d) - 1) * 9 + int(N[d])
        elif k == 2:
            return (
                ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81
                + ((L - d) - 1) * 9 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )
        elif k == 3:
            return (
                ((((L - d) - 1) * ((L - d) - 2) * ((L - d) - 3)) // 6) * (9 ** 3)
                + ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )

    print(main(0, K))



### FIXED CODE ###

N = input()
L = len(N)
K = int(input())
if L < K:
    print(0)
else:

    def main(d, k):
        if d == L:
            return 0
        if N[d] == "0":
            return main(d + 1, k)
        if (L - d) < k:
            return 0
        if k == 1:
            return ((L - d) - 1) * 9 + int(N[d])
        elif k == 2:
            return (
                ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81
                + ((L - d) - 1) * 9 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )
        elif k == 3:
            return (
                ((((L - d) - 1) * ((L - d) - 2) * ((L - d) - 3)) // 6) * (9 ** 3)
                + ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )

    print(main(0, K))
import math
n,k=map(int,input().split())

x=0
ans=0
for i in range(1,n+1):
    if k/i<=1:
        x=0
    else:
        x=int(math.log2(k/i))+1
    ans+=(1/n)*(1/2)**x
print(ans)
        


### FIXED CODE ###

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

x=0
ans=0

for i in range(1,n+1):
    score=i
    p=1/n
    while score<k:
        p*=0.5
        score*=2
    ans+=p
    

print(ans)
import math
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

index_of_1 = A.index(1)

if index_of_1 == 0:
    first = 0
else:
    first = math.ceil((index_of_1 + 1) / K)

if index_of_1 == N - 1:
    latter = 0
else:
    latter = math.ceil((N - index_of_1 + 1) / K)

print(first + latter)


### FIXED CODE ###

seq = input()
print(seq.count('+') - seq.count('-'))
A,B,C,K =  map(int,input().split())

count = 0

if K <= A:
    count += A
    print(count)

elif K <= A + B:
    count += A
    print (count)

else:
    count += 2*A + B - K
    print(count)


### FIXED CODE ###

S =  list(input())
T =  list(input())
del T[-1]

if S == T:
    print('Yes')

else:
    print('No')
a=int(input()
b=int(input()
c=int(input()
d=int(input()
e=int(input()
x=int(input()
ls=[a,b,c,d,e]
ls.sort()
if (ls[1]-ls[0])<=x and (ls[2]-ls[1])<=x and (ls[3]-ls[2])<=x and (ls[4]-ls[3])<=x:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=int(input())
ls=[a,b,c,d,e]
if (e-a)<=x:
  print("Yay!")
else:
  print(":(")
#https://atcoder.jp/contests/abc141/submissions/7539109
#Z-Algorithm
n = int(input())
s = input()
 
a = ""
ans = 0
for i in range(n):
    a += s[i]
    while(len(a) > 0):
        if a in s[i+1:]:    #見つかる限りこの処理
            ans = max(ans,len(a))
            break
        else:               #ダメなら次の文字を接頭辞に、短いものは調べなくてよい
        a = a[1:]
print(ans)

### FIXED CODE ###

#https://atcoder.jp/contests/abc141/submissions/7539109
#Z-Algorithm
n = int(input())
s = input()
 
a = ""
ans = 0
for i in range(n):
    a += s[i]
    while(len(a) > 0):
        if a in s[i+1:]:    #見つかる限りこの処理
            ans = max(ans,len(a))
            break
        else:               #ダメなら次の文字を接頭辞に、短いものは調べなくてよい
            a = a[1:]
print(ans)
# H,W = 3,3
# s = [".#.", "..#", "#.."]

from collections import deque
H,W = map(int, input().split())
s = [input() for _ in range(H)]

ans = 0
kaburi = 0
for i in range(H):
    for j in range(W):
        if s[i][j]==".": continue
        stk = deque([(i,j)]) # stktack
        visited = set([(i,j)])
        while stk: # なくなるまで
            y,x = stk.popleft()

            for dy,dx in ([1,0],[0,1],[-1,0],[0,-1]):
                if 0 <= y+dy < H and 0 <= x+dx < W:
                    if ((s[y][x]=="." and s[y+dy][x+dx] == "#")
                     or (s[y][x]=="#" and s[y+dy][x+dx] == ".") ):
                        if (y+dy,x+dx) in visited: continue
                        stk.append([y+dy,x+dx])
                        visited.add((y+dy,x+dx))
                        # print(i,j, y+dy,x+dx, ans)
                        if s[y+dy][x+dx]=="#": kaburi += 1
                        ans += 1
print(ans-kaburi)

### FIXED CODE ###

N = int(input())
H = int(input())
W = int(input())
ans = 0
for i in range(N):
    for j in range(N):
        if i+H-1<N and j+W-1<N:
            ans+=1
print(ans)
N = int(input())
L = list(map(int, input().split()))
l =sorted(L)
t = 0
for i in range(N-2):
  if i > 0 and l[i] = l[i-1]:
    break
  else:
    for k in range(i+1,N-1):
      for m in range(k+1, N):
        if l[m] < l[k] + l[i]:
          t += 1
        else:
          break
print(t)
      

### FIXED CODE ###

import bisect
n =int(input())
l =list(map(int, input().split()))
l.sort()
total = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    tmp = bisect.bisect_left(l,l[i]+l[j])
    total += tmp - j - 1
print(total)