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

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

res = 0
for i in range(N):
  move = 0
  for j in range(i,N-1):
    if H[j+1] <= H[j]:
      move += 1
    else:
      break
  res = max(res,move)

print(res)

### FIXED CODE ###

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

res = 0
cnt = 0

for i in range(N-1):
  if H[i] >= H[i+1]:
    cnt += 1
    if i == N-2:
      res = max(res,cnt)
  else:
    res = max(res,cnt)
    cnt = 0
    
print(res)
### BUGGY CODE ###

from itertools import product
from collections import deque
import numpy as np
class Grid():
    def __init__(self, grid, w=0, h=0, function=lambda x: x):
        self.w = w = w if w else len(grid[0])
        self.h = h = h if h else len(grid)
        dtype = type(function(grid[0][0]))
        self.grid = np.empty((h, w), dtype=dtype)
        for i, row in zip(range(h), grid):
            for j, val in zip(range(w), row):
                self.grid[i][j] = function(val)
    
    def is_valid_x(self, x):
        return 0 <= x < self.w
    def is_valid_y(self, y):
        return 0 <= y < self.h
    def is_valid_xy(self, x, y):
        return self.is_valid_x(x) and self.is_valid_y(y) 
    
    def __iter__(self):
        return iter(self.grid)
    def __repr__(self):
        return '\n'.join([' '.join(map(str, row)) for row in self.grid])
    def __getitem__(self, x):
        return self.grid[x]
    def __setitem__(self, x, val):
        self.grid[x] = val

X = iter(open(0).readlines())
h, w = map(int, next(X).split())
ch, cw = map(int, next(X).split())
dh, dw = map(int, next(X).split())
dp = Grid(list(X), function=lambda x: 10**6 if x == '.' else -1)

def bfs(root):
    x, y, d = root
    dp[y, x] = 0
    queue = deque([root])
    while queue:
        x, y, d = queue.popleft()
        for dx, dy in zip([1, 0, -1, 0], [0, 1, 0, -1]):
            nx, ny = x+dx, y+dy
            if dp.is_valid_xy(nx, ny) and dp[ny, nx] > d:
                if dp[ny, nx] > d:
                    dp[ny, nx] = d
                    queue.append((nx, ny, d))
        for dx, dy in product(range(-2, 3), repeat=2):
            if abs(dx) + abs(dy) < 2:
                continue
            nx, ny = x+dx, y+dy
            if dp.is_valid_xy(nx, ny) and dp[ny, nx] > d+1:
                if dp[ny, nx] > d+1:
                    dp[ny, nx] = d+1
                    queue.append((nx, ny, d+1))
bfs((cw-1, ch-1, 0))
if dp[dh-1, dw-1] == 10**6:
    print(-1)
else:
    print(dp[dh-1, dw-1])

### FIXED CODE ###

from collections import deque
from itertools import product
h, w = list(map(int,input().split()))
sy, sx = list(map(int,input().split()))
gy, gx = list(map(int,input().split()))
sx, sy, gx, gy = sx-1, sy-1, gx-1, gy-1
 
G = [list(input()) for _ in range(h)]
D = [[10**6]*w for _ in range(h)]
D[sy][sx] = 0
Q = deque([(sy, sx)])
while Q:
    y, x = Q.pop()
    for dy, dx in product(range(-2, 3), repeat=2):
        ny, nx = y+dy, x+dx
        if dx==dy==0:
            G[y][x] = '#'
            continue
        elif ny<0 or h<=ny or nx<0 or w<=nx:
            continue
        elif G[ny][nx] == '#':
            continue
        elif abs(dy)+abs(dx)<=1:
            G[ny][nx] = '#'
            D[ny][nx] = D[y][x]
            Q.append((ny, nx))
        elif D[ny][nx] == 10**6:
            D[ny][nx] = D[y][x]+1
            Q.appendleft((ny, nx))
            
if D[gy][gx] == 10**6:
    print(-1)
else:
    print(D[gy][gx])
### BUGGY CODE ###

from functools import lru_cache

def main(S):
    con = 10**9 + 7

    @lru_cache(maxsize=128, typed=True)
    def get_c(iii):
        return [(j * iii) % 13 for j in l10]

    l10 = list(range(10))
    l13 = list(range(13))
    c = []
    iii = 1
    for i in range(len(S)):
        s = S[len(S) - i - 1]
        if s != "?":
            c.append([(int(s) * iii) % 13])
        else:
            c.append(get_c(iii))
        iii = (iii * 10) % 13

    _tdp = {i: 0 for i in l13}
    it = iter(c)
    pdp = {i: 1 for i in next(it)}
    d = 1
    for v in it:
        tdp = _tdp.copy()
        for r in v:
            for _r, _v in pdp.items():
                tdp[(_r + r) % 13] += _v
        if d == 0:
            for i in l13:
                tdp[i] = tdp[i] % con
        d = (d + 1) % 50
        pdp = tdp

    ans = pdp.get(5, 0)
    print(ans % con)

if __name__ == "__main__":
    S = input()
    main(S)

### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            tdp[(_r + r) % 13] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
### BUGGY CODE ###

import sys

x=int(input())
a=1
b=0
s=0
while(1):
    while(1):
        if(a==b):
            break
        if x%(a-b)==0:
            A=a**5
            B=b**5
            k=x-A
            if(-B==k):
                print(a,b)
                sys.exit()
            elif (B==k):
                print(a,-b)
                sys.exit()
        b+=1
    a+=1

### FIXED CODE ###

import sys

x=int(input())
for i in range(-120,120):
    for j in range(-120,120):
        if(i**5-j**5==x):
            print(i,j)
            sys.exit()
### BUGGY CODE ###

import itertools

N = int(input())
S = input()

sum = 0
for i in range(0,N-2):
    for j in range(i+1,N-1):
        if S[i] == S[j]:
            continue
        for k in range(j+1,N):
            if S[i] == S[k] or S[j] == S[k]:
                continue
            if j - i != k - j:
                if (S[i] != S[j]) and (S[i] != S[k] and S[j] != S[k]):
                    sum += 1

print(sum)


### FIXED CODE ###

import itertools
from collections import Counter

N = int(input())
S = input()

C=Counter(S)
r = C['R']
g = C['G']
b = C['B']


cnt = r * g * b

for i in range(0,N-2):
    for j in range(i,N-1):
        k = j + j - i
        if k < N:
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                cnt -= 1

print(cnt)
### BUGGY CODE ###

from collections import deque

h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
move = [(1,0), (0,1), (-1,0), (0,-1)]

queue = deque([(row, col, 0) for row in range(h) for col in range(w) if a[row][col] == "#"])
visited = [[-1] * w for _ in range(h)]

while queue:
    row, col, dist = queue.popleft()
    if visited[row][col] == -1:
        visited[row][col] = 0
    for drow, dcol in move:
        if a[row+drow:row+drow+1] and a[row+drow][col+dcol:col+dcol+1] and visited[row+drow][col+dcol] == -1 and a[row+drow][col+dcol] == ".":
            visited[row+drow][col+dcol] = dist + 1
            queue.append((row+drow, col+dcol, dist+1))

result = 0
for row in visited:
    row_max = max(row)
    if row_max > result:
        result = row_max

print(result)


### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
move = [(1,0), (0,1), (-1,0), (0,-1)]

queue = deque()
visited = [[-1] * w for _ in range(h)]
for row in range(h):
    for col in range(w):
        if a[row][col] == "#":
            visited[row][col] = 0
            queue.append((row, col, 0))
dist = 0
while queue:
    row, col, dist = queue.popleft()
    for drow, dcol in move:
        if a[row+drow:row+drow+1] and a[row+drow][col+dcol:col+dcol+1] and visited[row+drow][col+dcol] == -1 and a[row+drow][col+dcol] == ".":
            visited[row+drow][col+dcol] = dist + 1
            queue.append((row+drow, col+dcol, dist+1))


print(dist)
### BUGGY CODE ###


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

lis = [a[0]] + [0] * (n-1)
fo = 1
be = -1

if n % 2 == 0:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:

            lis[be] = a[i]
            be -= 1
            #ans = str(a[i])+" "+ans

        else:

            lis[fo] = a[i]
            fo += 1
            #ans = ans+" "+ str(a[i])


else:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:
            
            lis[fo] = a[i]
            fo += 1
            #ans = str(a[i])+" "+ans

        else:
            
            lis[be] = a[i]
            be -= 1
            #ans = ans+" "+ str(a[i])

            
for i in range(n):

        i -= n//2

        ans += str(lis[i]) + " "


#print(lis)
print(ans)


### FIXED CODE ###


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

lis = [a[0]] + [0] * (n-1)
fo = 1
be = -1

if n % 2 == 0:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:

            lis[be] = a[i]
            be -= 1
            #ans = str(a[i])+" "+ans

        else:

            lis[fo] = a[i]
            fo += 1
            #ans = ans+" "+ str(a[i])


else:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:
            
            lis[fo] = a[i]
            fo += 1
            #ans = str(a[i])+" "+ans

        else:
            
            lis[be] = a[i]
            be -= 1
            #ans = ans+" "+ str(a[i])

            
for i in range(n):

        i -= n//2

        ans += str(lis[i]) + " "


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

import copy

n = int(input())
l = [int(input()) for i in range(n)]
for i in range(n):
    s = l[:i]+l[i+1:]
    print(max(s))

### FIXED CODE ###

import copy

n = int(input())
l = [int(input()) for i in range(n)]
Max1 = sorted(l)[-1]
Max2 = sorted(l)[-2]
for i in range(n):
    if l[i] == Max1:
        print(Max2)
    else:
        print(Max1)
### BUGGY CODE ###

N=int(input())
a=list(map(int,input().split()))
a.append(0)
cost=0
for idx in range(N):
    b=a.copy()
    b.pop(idx)
    cost=0
    for i in range(len(b)):
        if i==0:
            cost+=abs(b[i])
        else:
            cost+=abs(b[i-1]-b[i])
    print(cost)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
a.insert(0,0)
a.append(0)
cost=[]
for i in range(N+1):
    if i==0:
        cost.append(abs(a[i]))
    else:
        cost.append(abs(a[i-1]-a[i]))
cost.append(abs(a[N]))
S=sum(cost)
for i in range(N):
    print(S-cost[i+1]-cost[i+2]+abs(a[i+2]-a[i]))
### BUGGY CODE ###

from fractions import gcd
n = int(input())
A = list(map(int,input().split()))
res = 0
for i in range(n):
    B = A[:i]+A[i+1:]
    GCD = B[0]
    for b in B:
        GCD = gcd(GCD,b)
    if res < GCD:
        res = GCD
print(res)

### FIXED CODE ###

from fractions import gcd
n = int(input())
A = list(map(int,input().split()))
X = [0 for i in range(n)]
Y = [0 for i in range(n)]
for i in range(1,n):
    X[i] = gcd(X[i-1],A[i-1])
for i in range(n-1)[::-1]:
    Y[i] = gcd(Y[i+1],A[i+1])
#print(X)
#print(Y)
Z = [gcd(X[i],Y[i]) for i in range(n)]
print(max(Z))
### BUGGY CODE ###

N, K, *A = map(int, open(0).read().split())

A = [a + 1 for a in A]
M = max(A)

N0 = 2 ** (M - 1).bit_length()
data = [0] * (2 * N0)

def update(k, x):
    k += N0 - 1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = max(data[2 * k + 1], data[2 * k + 2])

def query(l, r):
    L = l + N0; R = r + N0
    s = 0
    while L < R:
        if R & 1:
            R -= 1
            s = max(s, data[R-1])

        if L & 1:
            s = max(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s

for a in A:
    x = query(max(1, a - K), min(a + K + 1, M + 1))
    update(a, x + 1)

print(query(1, M))

### FIXED CODE ###

N, K, *A = map(int, open(0).read().split())

A = [a + 1 for a in A]
M = max(A)

N0 = 2 ** (M - 1).bit_length()
data = [0] * (2 * N0)

def update(k, x):
    k += N0 - 1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = max(data[2 * k + 1], data[2 * k + 2])

def query(l, r):
    L = l + N0; R = r + N0
    s = 0
    while L < R:
        if R & 1:
            R -= 1
            s = max(s, data[R-1])

        if L & 1:
            s = max(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s

for a in A:
    x = query(max(1, a - K), min(a + K + 1, M + 1))
    update(a, x + 1)

print(query(1, M))
### BUGGY CODE ###

X,K,D = list(map(int , input().split()))
ans = 0
if (X >=0):
    a = K*D
    if (X >= a):
        ans = X-a
    else:
        time = 0
        while (True):
            X -= D
            time += 1
            if X <= 0:
                break
        nokori = (K - time) % 2
        ans = X + D*nokori
else:
    a = -(K*D)
    if (X <= a):
        ans = X-a
    else:
        time = 0
        while (True):
            X += D
            time += 1
            if X >= 0:
                break
        nokori = (K - time) % 2
        ans = X - D*nokori
Answ = abs(ans)
print(Answ)


### FIXED CODE ###

X,K,D = list(map(int , input().split()))
ans = 0
if (X >=0):
    a = K*D
    if (X >= a):
        ans = X-a
    else:
        time = 0
        while (True):
            X -= D
            time += 1
            if X <= 0:
                break
        nokori = (K - time) % 2
        ans = X + D*nokori
else:
    a = -(K*D)
    if (X <= a):
        ans = X-a
    else:
        time = 0
        while (True):
            X += D
            time += 1
            if X >= 0:
                break
        nokori = (K - time) % 2
        ans = X - D*nokori
Answ = abs(ans)
print(Answ)
### BUGGY CODE ###

s=raw_input()
q=int(raw_input())

r=False
for i in range(0, q):
    t=raw_input()
    if t[0] == "1":
        r = not r
        #s = s[::-1]
    else:
        if t[2] == "1" and r is False or t[2] == "2" and r is True:
            s = t[4] + s
        else:
            s = s + t[4]

if r is True:
    s = s[::-1]
print s


### FIXED CODE ###

from collections import deque
#s=raw_input()

l=deque(list(input()))
q=int(input())

r=False
for i in range(0, q):
    t=input()
    if t[0] == "1":
        r = not r
        #s = s[::-1]
    else:
        if t[2] == "1" and r is False or t[2] == "2" and r is True:
            #s = t[4] + s
            l.appendleft(t[4])
        else:
            #s = s + t[4]
            l.append(t[4])

if r is True:
    #s = s[::-1]
    l = list(l)[::-1]

#print s
print("".join(l))
### BUGGY CODE ###

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

cnt = 0
for i in range(N):
    Flg = True
    for j in range(i+1):
        if P[j] < P[i]:
            Flg = False
            break
    if Flg:
        cnt += 1
print(cnt)


### FIXED CODE ###

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

cnt = 0
min_value = N + 1
for i in range(N):
    if P[i] <= min_value:
        cnt += 1
        min_value = P[i]
print(cnt)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
C - 755

"""
import sys


from itertools import product

def gen_357():
    def conv(n):
        res = []
        while n:
            n, r = divmod(n, 4)
            res.append(r)
        t = list(map(str, res[::-1]))
        if not t: t = ['0']
        x = ''.join(t).translate(str.maketrans('0123', '0357'))
        return int(x)

    n = 0
    while True:
        t = conv(n)
        while '0' in str(t) or len(set(list(str(t)))) != 3:
            n += 1
            t = conv(n)
        yield t
        n += 1


def solve(n):
    ans = 0
    g = gen_357()
    while True:
        t = next(g)
        if t > n:
            break
        ans += 1
    return ans


def main(args):
    n = int(input())
    ans = solve(n)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
C - 755
TLE
"""
def gen_357():
    def conv(n):
        res = []
        while n:
            n, r = divmod(n, 4)
            if r == 0 and n:
                return '0'
            res.append(str(str(r)))
        if not res:
            res = ['0']
        return ''.join(res[::-1]).translate(str.maketrans('0123', '0357'))

    n = 0
    while True:
        t = conv(n)
        while '0' in t or len(set(list(t))) != 3:
            n += 1
            t = conv(n)
        yield t
        n += 1


def solve(n):
    ans = 0
    g = gen_357()
    while True:
        t = next(g)
        if int(t) > n:
            break
        ans += 1
    return ans


n = int(input())
ans = solve(n)
print(ans)
### BUGGY CODE ###

n, a, b = map(int, input().split())
c = 1
d = 1
for i in range(1, n+1):
    c = c * i
ans = []
e = c
for i in range(1, n+1):
    d = d * i
    e = int(e / (n-i+1))
    #print(i, c, d, e)
    if i != a and i != b:
        ans.append(int(c/(d*e)))
#print(ans)
print(sum(ans)%(10**9+7))

### FIXED CODE ###

def cmb(n, r, p):
    r = min(r, n - r)
    upper = 1
    for i in range(n, n - r, -1):
        upper = (upper * i) % p

    lower = 1
    for i in range(1, r + 1):
        lower = (lower * i) % p

    # フェルマーの小定理よりp素数ならupper**(p-2)は逆元
    return (upper * pow(lower, p - 2, p)) % p

mod = pow(10, 9) + 7
n, a, b = map(int, input().split())
ans = (pow(2, n, mod) - 1 - cmb(n, a, mod) - cmb(n, b, mod))%mod
print(ans)
### BUGGY CODE ###

import heapq


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    F = [int(x) for x in input().split()]

    A = sorted(A)
    F = reversed(sorted(F))

    cost_list = []
    for a, f in zip(A, F):
        cost_list.append([-a*f, a, f])

    heapq.heapify(cost_list)

    for _ in range(K):
        max_cost = heapq.heappop(cost_list)
        max_cost[1] -= 1
        max_cost[0] = -max_cost[1]*max_cost[2]
        heapq.heappush(cost_list, max_cost)

    print(-cost_list[0][0])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import numpy as np


def main():
    N, K = [int(x) for x in input().split()]
    A = [float(x) for x in input().split()]
    F = [float(x) for x in input().split()]

    A = np.array(sorted(A))
    F = np.array(sorted(F, reverse=True))

    if K >= np.sum(A)*N:
        print(0)
        exit()

    min_time = 0
    max_time = A[-1] * F[0]

    while max_time != min_time:
        tgt_time = (min_time + max_time)//2
        ideal_a = np.floor(tgt_time*np.ones(N)/F)
        cost = A - ideal_a
        require_k = np.sum(cost[cost > 0])
        if require_k <= K:
            max_time = tgt_time
        else:
            min_time = tgt_time+1

    print(int(max_time))


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

N,M = map(int,input().split())
Xs = list(map(int,input().split()))
Xs.sort()
Xdivs = []
for i in range(M-1):
    Xdivs.append(Xs[i+1]-Xs[i])
for _ in range(N-1):
    for i,x in enumerate(Xdivs):
        if Xdivs[i] == max(Xdivs):
            Xdivs[i] = 0
            break
print(sum(Xdivs))

### FIXED CODE ###

N,M = map(int,input().split())
Xs = list(map(int,input().split()))
if len(Xs) <= N:
    print(0)
else:
    Xs.sort()
    Xdivs = []
    for i in range(M-1):
        Xdivs.append(Xs[i+1]-Xs[i])
    Xdivs.sort()
    print(sum(Xdivs[:M-N]))
### BUGGY CODE ###

S = input()
Q = int(input())
Flag = True

for i in range(Q):
    Query = input()
    if Query[0] == "1":
        Flag = not Flag
    else:
        QueryList = Query.split()
        if Flag:
            if QueryList[1] =="1":
                S = QueryList[2]+S
            else:
                S = S+QueryList[2]
        else:
            if QueryList[1] =="2":
                S = QueryList[2]+S
            else:
                S = S+QueryList[2]

if Flag:
    print(S)
else:
    for i in range(len(S)):
        print(S[len(S)-i-1], end="")

### FIXED CODE ###

from collections import deque

d = deque()
S = input()
d.append(S)
Q = int(input())
Flag = True
 
for i in range(Q):
    Query = input()
    if Query[0] == "1":
        Flag = not Flag
    else:
        QueryList = Query.split()
        if Flag:
            if QueryList[1] =="1":
                d.appendleft(QueryList[2])
            else:
                d.append(QueryList[2])
        else:
            if QueryList[1] =="2":
                d.appendleft(QueryList[2])
            else:
                d.append(QueryList[2])

d_string = "".join(list(d))

if not Flag:
    d_string = d_string[::-1]    
print(d_string)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
anslist = []
for i in range(n):
    print(a.index(i+1) + 1, end=' ')

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mydict = {}
for i in range(n):
    mydict[str(i+1)] = a[i]
mydict = sorted(mydict.items(), key= lambda x:x[1])
for j in range(n):
    print(mydict[j][0], end=' ')
### BUGGY CODE ###

R,G,B,N = map(int,input().split())
ans = 0
for r in range(N//R+1):
  for g in range((N-R*r)//G+1):
    if r*R+g*G>N:
      continue
    if (N-r*R-g*G)%B==0:
      ans+=1
print(ans)


### FIXED CODE ###

R,G,B,N = map(int,input().split())
ans = 0
for r in range(N+1):
  if r*R>N:
    break
  for g in range(N+1):
    S = N-r*R-g*G
    if S<0:
      break
    elif S%B==0:
      ans+=1
print(ans)
### BUGGY CODE ###

s = input()
t = input()
def check(a,b):
  for c in a:
    if a.count(c) > 1:
      m = [i for i, x in enumerate(a) if x == c]
      w = b[m[0]]
      for i in range(1,len(m)):
        if b[m[i]] != w:
          return "No" 
  return "Yes"
ans = check(s,t)
if ans == "Yes" : ans = check(t,s)
print(ans)

### FIXED CODE ###

s = input()
t = input()
def check(a,b):
  l = []
  for c in a:
    if c in l:
      continue
    l.append(c)
    if a.count(c) > 1:
      m = [i for i, x in enumerate(a) if x == c]
      for i in range(1,len(m)):
        if b[m[i]] != b[m[0]]:
          return "No" 
  return "Yes"
ans = check(s,t)
if ans == "Yes" : ans = check(t,s)
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 13:14:10 2018
ALDS1-4c simple implementation
@author: maezawa
"""

n = int(input())
a = []
for s in range(n):
    cmd, word = input().split()
    if cmd == 'insert':
        a.append(word)
    else:
        if word in a:
            print('yes')
        else:
            print('no')




### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 13:14:10 2018
ALDS1-4c  implementation with dictionary
@author: maezawa
"""

n = int(input())
a = dict([])
for s in range(n):
    cmd, word = input().split()
    if cmd == 'insert':
        a[word]=''
    else:
        if word in a:
            print('yes')
        else:
            print('no')
### BUGGY CODE ###

N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = []
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            if L[i] < L[j]+L[k] and L[j] < L[k]+L[i] and L[k] < L[i]+L[j]:
                ans.append(0)
print(len(ans))

### FIXED CODE ###

import bisect

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

cnt = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        cnt += bisect.bisect_left(L, L[i]+L[j]) - (j+1)

print(cnt)