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

import sys
input = sys.stdin.readline
import math
def print_ans(N,H):
    """Test Case
    >>> print_ans(5, "10 4 8 7 3")
    2
    >>> print_ans(7, "4 4 5 6 6 5 5")
    3
    >>> print_ans(4, "1 2 3 4")
    0
    """
    h_arr = list(map(int,H.split()))
    ans = 0
    for i in range(N):
        tmp = h_arr[i]
        tmp_ans = 0
        for k in range(i + 1, N):
            if tmp >= h_arr[k]:
               tmp_ans += 1
               tmp = h_arr[k]
            else:
                break
        ans = max(ans,tmp_ans)
    print(ans)
            


if __name__ == '__main__':
    N = int(input().rstrip())
    H = input().rstrip()
    print_ans(N,H)

### FIXED CODE ###

import sys
input = sys.stdin.readline
import math
def print_ans(N,H):
    """Test Case
    >>> print_ans(5, "10 4 8 7 3")
    2
    >>> print_ans(7, "4 4 5 6 6 5 5")
    3
    >>> print_ans(4, "1 2 3 4")
    0
    """
    h_arr = list(map(int,H.split()))
    ans = 0
    ofs = 0
    for i in range(N):
        if ofs == i:
            tmp = h_arr[i]
            tmp_ans = 0
            for k in range(i + 1, N):
                ofs += 1
                if tmp >= h_arr[k]:
                    tmp_ans += 1
                    tmp = h_arr[k]
                else:
                    break
            ans = max(ans,tmp_ans)
    print(ans)
            


if __name__ == '__main__':
    N = int(input().rstrip())
    H = input().rstrip()
    print_ans(N,H)
### BUGGY CODE ###

from itertools import accumulate
from operator import add, mul
import sys 
input = sys.stdin.readline


n = int(input())

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


b = accumulate(a, mul)

c = list(b)


# b=1
# for i in range(n):
#     b *= a[i]
    
if c[n-1] > 10**18:
    print('-1')
else:
    # print(b)
    print(c[n-1])


### FIXED CODE ###

# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)
### BUGGY CODE ###

import fractions
N = int(input())
As = list(map(int, input().split()))
As.sort()
ans = 1
 
for i in range(N):
    flag = True
    if i == 0:
        a = As[1]
    else:
        a = As[0]
    for j in range(N):
        if j != i:
            a = fractions.gcd(a, As[j])
            if a <= ans:
                flag = False
                break
    if flag:
        ans = a
print(ans)
        

### FIXED CODE ###

import fractions
import collections
N = int(input())
As = list(map(int, input().split()))
lgcd = [As[0]]
rgcd = collections.deque([As[-1]])
l = As[0]
r = As[-1]
for i in range(1, N):
    l = fractions.gcd(l, As[i])
    r = fractions.gcd(r, As[-(i+1)])
    lgcd.append(l)
    rgcd.appendleft(r)
ans = [lgcd[N-2], rgcd[1]]
for i in range(1, N-1):
    ans.append(fractions.gcd(lgcd[i-1], rgcd[i+1]))
print(max(ans))
### BUGGY CODE ###

N = int(input())
X = []
for i in range(N):
    A = int(input())
    target = [x for x in X if x < A]
    if len(target) > 0:
        X[X.index(max(target))] = A
    else:
        X.append(A)
print(len(X))


### FIXED CODE ###

import bisect

N = int(input())
A = [-int(input()) for i in range(N)]
X = []
for i in range(N):
    a = A[i]
    idx = bisect.bisect_left(X, a+0.1)
    if idx == len(X):
        X.append(a)
    else:
        X[idx] = a
print(len(X))
### BUGGY CODE ###

X, Y = map(int,input().split())
DIV = 10**9 + 7
#y=2x以下かつy=(1/2)x以上の位置にいなくてはいけない
N = (X+Y)//3
#NCAを求める
nkai = 1
for l in range(1,N+1):
    nkai *= l
ans = 0
if (X+Y) % 3 != 0:
    ans = 0
else:
    #操作の回数 A+B = N
    N = (X+Y) // 3
    for i in range(N+1):
        count = 0
        A = i
        B = N - i
        if (A+2*B) == X and (2*A + B) == Y:
            akai = 1
            nakai = 1
            for m in range(1,A+1):
                akai *= m
            for n in range(1,N-A+1):
                nakai *= n
            count = (nkai)//(akai*nakai)
            ans += 1*count
ans = ans % DIV
print(ans)

### FIXED CODE ###

X, Y = map(int,input().split())
def combination(n,r,mod=10**9+7):
    n1 = n+1
    r = min(r,n-r)
    numer = denom = 1
    for i in range(1,r+1):
        numer = numer * (n1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom,mod-2,mod) % mod

#y=2x以下かつy=(1/2)x以上の位置にいなくてはいけない
if (X+Y) % 3 != 0 or not (X<=2*Y and Y <=2*X):
    ans = 0
else:
    N = (X+Y)//3
    r = Y - N
    ans = combination(N,r)
print(ans)
### BUGGY CODE ###

import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans = (ans + lcm // x) % MOD
print(ans)

### FIXED CODE ###

import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans += lcm // x
print(ans % MOD)
### BUGGY CODE ###

import operator as op
N, A, B, K = map(int, raw_input().split())
ab = []
max_a = K // A
max_a = min(max_a, N)
for i in range(max_a+1):
  if ((K-A*i) % B) == 0:
    j = (K-A*i) / B
    if j > N:
      continue
    ab.append([i, j])

def ncr(n, r):
  r = min(r, n-r)
  numer = reduce(op.mul, xrange(n, n-r, -1), 1)
  denom = reduce(op.mul, xrange(1, r+1), 1)
  return numer//denom

total = 0
for a, b in ab:
  total += ncr(N, a) * ncr(N, b)
print(total % 998244353)


### FIXED CODE ###

MOD = 998244353
fact = [1] * 300001
ifact = [1] * 300001

for i in range(1, 300001):
    fact[i] = (fact[i-1] * i) % MOD
    ifact[i] = pow(fact[i], MOD-2, MOD)

def nCk(n, k):
    if k < 0 or k > n: return 0
    return (fact[n] * ifact[n-k] * ifact[k]) % MOD

N, A, B, K = map(int, raw_input().split())
ab = []
max_a = K // A
max_a = min(max_a, N)
for i in range(max_a+1):
  if ((K-A*i) % B) == 0:
    j = (K-A*i) / B
    if j > N:
      continue
    ab.append([i, j])

total = 0
for a, b in ab:
  total += nCk(N, a) * nCk(N, b)
print(total % MOD)
### BUGGY CODE ###

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

AB_list =[]
for i in range(N):
    AB_list.append(tuple(map(int,input().split())))

AB_list.sort()
#print(AB_list)
ans = 0

for i in range(M):
    hoshu = 0
    t = 0
    flag = False
    for j in range(N):
        if (AB_list[j][0] <= i+1):
            if hoshu <= AB_list[j][1]:
                hoshu = AB_list[j][1]
                t = j
                flag = True

        else:
            break

    if flag:
        del AB_list[t]
        N -= 1
    #print(hoshu, t)
    ans += hoshu
    #print(AB_list)

print(ans)






### FIXED CODE ###

import heapq

# 標準入力受け取り
N, M = list(map(int, input().split()))
jobs = [[] for _ in range(M)]  #日数分(M)だけ[]を用意
# print(jobs)

for i in range(N):
    d, r = list(map(int, input().split()))   #d = A[i], r = B[i]
    if d - 1 < M:   #d-1番目の要素にrを追加して、同じ受け取り日数のバイトを同じ要素に入れる。d-1より、2日後のはjobs[1]におかれる。
        jobs[d - 1].append(-r)  # マイナスにしている
# print(jobs)

rewards = 0
heap = []

# 解法
for i in range(M):
    # 要素を一つづつヒープに追加
    for reward in jobs[i]:
        heapq.heappush(heap, reward)
    # print(heap)
    if len(heap) > 0:
        # 最大値(最小値)をヒープから取り出し
        reward = heapq.heappop(heap)
        rewards += -reward  # マイナスにしている
    # print(heap)

print(rewards)
### BUGGY CODE ###

import numpy as np

n = input()
a = np.array([int(num) for num in input().split(' ')])

sum = 10000000000
for i in range(1, len(a)):
    sunuke = a[0: i].sum()
    araiguma = a[i:].sum()
    dif = abs(sunuke - araiguma)
    if dif < sum: sum = dif
print(sum)


### FIXED CODE ###

import numpy as np

n = input()
a = np.array([int(num) for num in input().split(' ')])

min = 100000000000
sunuke = 0
araiguma = a.sum()
for i in range(0, len(a) - 1):
    sunuke += a[i]
    araiguma -= a[i]
    dif = abs(sunuke - araiguma)
    if dif < min: min = dif
print(min)
### BUGGY CODE ###

import bisect
n = int(input())
m = list(map(int,input().split()))
num=1
for i in range(n):
  if num in m:
    t = m.index(num)
    del m[:t]
    num+=1
  else:
    break

if num == 1:
  print(-1)
else:
  print(n-num+1)

### FIXED CODE ###

n = int(input())
m = list(map(int,input().split()))
num=1
for i in range(n):
  if m[i] == num:
    num+=1
    
if num == 1:
  print(-1)
else:
  print(n-num+1)
### BUGGY CODE ###

import numpy as np
n,k = map(int,input().split())

p = np.array(list(map(int,input().split())))

def expect(ps,k):
    return sum((ps + 1)/2)

ans = 0
for i in range(n-k+1):
    ps = p[i:(i+k)]
    ans = max(ans,expect(ps,k))


print(ans)


### FIXED CODE ###

import numpy as np
n,k = map(int,input().split())

p = np.array(input().split(),np.int)


fs = p[:k]
f = sum(fs)
m = n - k + 1
qs = np.zeros(m)
qs[0] = f
if n == k:
    ans = (f + k)/2
    print(ans)
else:
    for i in range(k,n):
        a = qs[i-k] - p[i-k] + p[i]
        qs[i-k+1] = a
    ans = (max(qs)+k) / 2
    print(ans)
### BUGGY CODE ###

MOD = 10**9 + 7

def nCr(n,r,mod):
  if n<r:
    return 0
  ret=1  
  for i in range(min(r,n-r)):
    ret = ret*(n-i)*pow(min(r,n-r)-i,mod-2,mod)%mod

  return ret%mod  

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

mi = 0
ma = 0

for i in range(1,n):
  mi = (mi + A[i-1] * nCr(n-i,k-1,MOD)) % MOD
  ma = (ma + A[-i]  * nCr(n-i,k-1,MOD)) % MOD
  
print((ma - mi)%MOD)

### FIXED CODE ###

mod = 10**9 + 7

N_MAX = 10**5+1
fact = [1] * N_MAX
for i in range(1,N_MAX):
  fact[i] = (fact[i-1]*i) % mod
  
def nCr(n,r):  
  if n < r:
    return 0
  return (fact[n] * pow(fact[r]*fact[n-r] ,mod-2,mod))% mod

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

mi = 0
ma = 0

for i in range(1,n):
  m = nCr(n-i,k-1)
  mi += A[i-1] * m
  ma += A[-i]  * m
  
print((ma - mi)%mod)
### BUGGY CODE ###

# 入力
def main():
    N = int(input())
    A = list(map(int,input().split()))

    P = 10**9+7
    bit = [0 for i in range(60)]

    # 各bit独立に1が何個あるか数える
    for a in A:
        S = bin(a)
        for j in range(1,len(S)-1):
            if S[-1*j] == '1':
                bit[j-1] += 1

    # 各bitの1の個数と0の個数の積が、XOR和が1になる数字の個数と一致
    ans = 0
    for i,a in enumerate(bit):
        ans += a*(N-a)*(2**i)
        ans %= P

    print(ans)

if __name__ == "__main__":
	main()


### FIXED CODE ###

# 入力
N = int(input())
A = list(map(int,input().split()))

ans = 0
P = 10**9+7
bit = [0 for i in range(70)]

# 各bit独立に1が何個あるか数える
for i in range(N):
    S = bin(A[i])
    for j in range(1,len(S)-1):
        if S[-1*j] == '1':
            bit[j-1] += 1

# 各bitの1の個数と0の個数の積が、XOR和が1になる数字の個数と一致
for i in range(70):
    ans += (2**i)*bit[i]*(N-bit[i])
    ans %= P

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

n = int(input())
a = list(map(int, input().split()))
def divisor(n):
    ret = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ret.append(i)
            if i*i != n:
                ret.append(n//i)
    return ret
from collections import Counter
c = Counter(a)
ans = 0
for i in a:
    for j in divisor(i):
        if j == i:
            if c[j] > 1:
                break
        else:
            if c[j] > 0:
                break
    else:
        ans += 1
print(ans)

### FIXED CODE ###

from collections import Counter

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    c = Counter(a)
    used = set()
    m = 10**6 + 1
    cnt = [0]*m
    ans = 0
    for ai in a:
        if c[ai]>1:
            if ai not in used:
                used.add(ai)
                for i in range(ai, m, ai):
                    cnt[i] += 1
        else:
            if cnt[ai] == 0:
                ans += 1
                for i in range(ai, m, ai):
                    cnt[i] += 1
    print(ans)

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

import sys
input = sys.stdin.readline

def main(): 
    N, M = list(map(int, input().split()))
    n = 2**N
    dp = [[float('inf') for i in range(n)] for j in range(M+1)]
    for i in range(M+1): dp[i][0] = 0

    for i in range(1, M+1):
        a, b = list(map(int, input().split()))
        t = 0

        for c in list(map(int, input().split())):
            t += 2**(c-1)

        for j in range(n): dp[i][j] = dp[i-1][j]
        for j in range(n):
            dp[i][j | t] = min(dp[i][j | t], dp[i-1][j | t], dp[i-1][j]+a)

    ans = dp[-1][-1]
    if ans == float('inf'): print(-1)
    else: print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N, M = map(int, input().split())
    INF = float('inf')
    
    L = 2 ** N
    dp = [INF] * L
    dp_next = [INF] * L
    
    nums = [2 ** i for i in range(N)]
    
    for i in range(M):
        a, b = map(int, input().split())
        b = sum([nums[c-1] for c in list(map(int, input().split()))])            
    
        dp[b] = min(dp[b], a)
        for j in range(L):
            n = j | b
            dp_next[n] = min(dp[n], dp_next[n], dp[j]+a)
        
        for j in range(L):
            dp[j] = dp_next[j]
            
    if dp[-1] == INF: print(-1)
    else: print(dp[-1])

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

n = int(input())
h = input().split()

b = True
for i in range(0,n):
    for j in range(i,n):
        if int(h[i]) - int(h[j]) > 1:
            print("No")
            b = False
if b:
    print("Yes")


### FIXED CODE ###

n = int(input())
hs = input().split()

h = []
for s in hs:
    h.append(int(s))

max = 0
for i in range(0,n):
    if max < h[i]:
        max = h[i]
    if max - h[i] > 1:
        print("No")
        exit()

print("Yes")
### BUGGY CODE ###

import sys
import numpy as np


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = np.array(list(map(int, input().split())))
    List = np.unique(A)
    count = np.bincount(A)

    dic = {}
    Ans = 0
    for l in List:
        n = count[l]
        num = n * (n - 1) // 2
        Ans += num
        dic[l] = num

    for i in range(N):
        n = count[A[i]] - 1
        num = n * (n - 1) // 2
        answer = Ans - dic[A[i]] + num
        print(answer)


main()


### FIXED CODE ###

import sys
import numpy as np


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = np.array(list(map(int, input().split())))
    count = np.bincount(A)
    # print(count)
    total = (count * (count - 1)).sum() // 2
    answer = (total - (count - 1))[A]
    print("\n".join(answer.astype(str)))


main()
### BUGGY CODE ###

import numpy as np
raw_input()
Ali = np.array( map(int,raw_input().split()))
Bli =np.array(map(int,raw_input().split()))
Cli =np.array(map(int,raw_input().split()))
Ali = np.sort(Ali)
Cli = np.sort(Cli)[::-1]
co=0
for B in Bli:
    ca = 0 
    for A in Ali:
        if A >= B:
            break
        else:
            ca+=1
    cb =0
    for C in Cli:
        if C <= B:
            break
        else:
            cb +=1 
    co += ca*cb
print(co)


### FIXED CODE ###

import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)
### BUGGY CODE ###

n=int(input())
def c(i,j):
	cnt=0
	for k in range(n):
		p=str(k+1)
		if p[0]==str(i) and p[-1]==str(j):
			cnt+=1
	return cnt
ans=0
for i in range(10):
	for j in range(10):
		ans+=c(i,j)*c(j,i)
print(ans)

### FIXED CODE ###

n=int(input())
c=[[0]*10 for _ in range(10)]
for i in range(n):
	s=str(i+1)
	c[int(s[0])][int(s[-1])]+=1
ans=0
for i in range(10):
	for j in range(10):
		ans+=c[i][j]*c[j][i]
print(ans)
### BUGGY CODE ###

cnt = 0
def merge(A, left, mid, right):
  global cnt
  #print("marge ",A,left,mid,right)
  n1 = mid - left
  n2 = right - mid
  #L = [0] * (n1+1)
  #R = [0] * (n2+1)
  L = [0] * (n1+1)
  R = [0] * (n2+1)
  
  for i in range(int(n1)):
    L[i] = A[left + i]
  for i in range(int(n2)):
    R[i] = A[mid + i]
  L[n1] = 999999999
  R[n2] = 999999999
  i = 0
  j = 0
  for k in range(left,right):
    cnt+=1
    if L[i] <= R[j]:
      A[k] = L[i]
      i = i + 1
    else:
      A[k] = R[j]
      j = j + 1

def mergeSort(A, left, right):
  #print("margeSort ",A,left,right)
  if left+1 < right:
    mid = int((left + right)/2)
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

n = int(input())
S = list(map(int,input().split()))
mergeSort(S, 0, n)
S = map(str, S)
print(' '.join(S))
print(cnt)


### FIXED CODE ###

cnt = 0
def merge(A, left, mid, right):
  global cnt
  #print("marge ",A,left,mid,right)
  n1 = mid - left
  n2 = right - mid
  #L = [0] * (n1+1)
  #R = [0] * (n2+1)
  L = [0] * (n1+1)
  R = [0] * (n2+1)
  
  for i in range(n1):
    L[i] = A[left + i]
  for i in range(n2):
    R[i] = A[mid + i]
  L[n1] = 999999999
  R[n2] = 999999999
  i = 0
  j = 0
  for k in range(left,right):
    cnt+=1
    if L[i] <= R[j]:
      A[k] = L[i]
      i = i + 1
    else:
      A[k] = R[j]
      j = j + 1

def mergeSort(A, left, right):
  #print("margeSort ",A,left,right)
  if left+1 < right:
    mid = int((left + right)/2)
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

n = int(input())
S = list(map(int,input().split()))
mergeSort(S, 0, n)
S = map(str, S)
print(' '.join(S))
print(cnt)
### BUGGY CODE ###

import numpy as np
def f(n):
    count = 0
    x_max = int(np.sqrt(n-5)//1)
    for x in range(1,x_max+1):
        y_max = int(np.sqrt(n-x**2-4)//1)
        for y in range(1,y_max+1):
            z_max = int(np.sqrt(n-x**2-y**2-3)//1)
            for z in range(1,z_max+1):
                if x**2+y**2+z**2+x*y+y*z+z*x == n:
                    count += 1
    return count

N = int(input())
if N >=6:
    for i in range(5):
        print(0)
    for i in range(5,N):
        print(f(i+1))
else:
    for i in range(N):
        print(0)

### FIXED CODE ###

import numpy as np
def f(n):
    counts = [0]*n
    x_max = int(np.sqrt(n))
    for x in range(1,x_max+1):
        y_max = int(np.sqrt(n-x**2))
        for y in range(1,y_max+1):
            z_max = int(np.sqrt(n-x**2-y**2))
            for z in range(1,z_max+1):
                if x**2+y**2+z**2+x*y+y*z+z*x <= n:
                    counts[x**2+y**2+z**2+x*y+y*z+z*x-1] += 1
    return counts
 
N = int(input())
counts = f(N)
for i in range(N):
    print(counts[i])
### BUGGY CODE ###

a,b,k = map(int,input().split())
for i in range(a,b+1):
    if i < a+k or b-k < i:
        print (i)


### FIXED CODE ###

a,b,k = map(int,input().split())
l = []
for i in range(a,min(a+k,b)):
    print (i)
    l.append(i)

for i in range(max(a,b-k+1),b+1):
    if not i in l:
        print (i)
### BUGGY CODE ###

a, b, n = map(int, input().split())
c = [0 for i in range(n+1)]
for x in range(n+1):
  c[x] = (a*x)//b - a*(x//b)
print(max(c))

### FIXED CODE ###

a, b, n = map(int, input().split())
x = min(b-1,n)
print((a*x)//b - a*(x//b))
### BUGGY CODE ###

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

if B - A <= 2: #ビスケットを叩き続けるパターン
    ans = 1 + 1 * K
    print(ans)
else:
    cnt = 0
    money = 0
    bis = 1
    while cnt < K:
        if K - cnt >= 2:
            if bis >= A: #ビスケットをお金に交換
                bis -= A
                money += 1
            elif money == 1: #お金をビスケットに交換
                bis += B
                money -= 1
            else: #ビスケットを叩く
                bis += 1
        else:
            bis += 1
        cnt += 1
    print(bis)


### FIXED CODE ###

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

if B - A <= 2 or K <= A: #交換しても増やせないorお金をビスケットに交換できない
    ans = K + 1
else:
    n = K - (A + 1)
    n_loop =  n // 2
    n_tataku = n % 2
    ans = B + n_loop * (B-A) + n_tataku
print(ans)
### BUGGY CODE ###

import numpy as np
n, k, q = map(int, input().split())
L = np.array([k]*n)
ones = np.array([1]*n)
for i in range(q):
  a = int(input())
  L -= ones
  L[a-1] += 1
    
for i in range(n):
  if L[i] > 0:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

n, k, q = map(int, input().split())
L = [0]*n
for i in range(q):
  a = int(input())
  L[a-1] += 1
    
for i in range(n):
  if k - q + L[i] > 0:
    print('Yes')
  else:
    print('No')
### BUGGY CODE ###

from collections import Counter
n = int(input())
sl = []
for i in range(n):
    d = Counter(list(input()))
    sl.append(d)

ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        jud = True
        for k in list(sl[i].keys()):
            if sl[j][k] != sl[i][k]:
                jud = False
                break
        if jud:
            ans += 1
print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
sl = []
for i in range(n):
    s = list(input())
    s.sort()
    sl.append("".join(s))
d = Counter(sl)

def cul(n):
    return n*(n - 1)//2

ans = 0
val = d.values()
for i in val:
    if i > 1:
        ans += cul(i)
print(ans)
### BUGGY CODE ###

n = int(input())

def div(k):
    i = 1
    ans = 0
    while i**2 <= k:
        if k%i == 0:
            ans += 2
        if i**2 == k:
            ans -= 1
        i += 1
    return ans

an = 0
for i in range(1, n+1):
    an += i*div(i)

print(an)


### FIXED CODE ###

n = int(input())

def cal(i):
    s = (i + i*(n//i))*(n//i)*0.5
    return s

ans = 0
for i in range(1, n+1):
    ans += cal(i)
    
print(int(ans))
### BUGGY CODE ###

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

for i in range (0, N):
  print(A.count(i+1))

### FIXED CODE ###

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

K = [0]*N

for i in range (0, N-1):
	K[L[i]-1]+=1

print(*K, sep = "\n")
### BUGGY CODE ###


def main():
    """"ここに今までのコード"""
    import sys
    input = sys.stdin.readline
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    A.sort()
    if n==1:
        ans=(m//(A[0]//2)+1)//2
        print(int(ans))
        exit()
    from fractions import gcd
    kou=A[0]*A[1]//gcd(A[0],A[1])
    from bisect import bisect_right as br
    c=br(A,A[-1]//2)
    for a in A:
        kou=a*kou//gcd(a,kou)
    if (kou//A[0])%2==0:
            print(0)
            exit()
    kou//=2
    #print(kou)
    ans=(m//kou+1)//2
    print(int(ans))
if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    """"ここに今までのコード"""
    import sys
    input = sys.stdin.readline
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    #A.sort()
    if n==1:
        ans=(m//(A[0]//2)+1)//2
        print(int(ans))
        exit()
    from fractions import gcd
    kou=A[0]*A[1]//gcd(A[0],A[1])
    for a in A:
        kou=a*kou//gcd(a,kou)
        if (kou//a)%2==0:
            print(0)
            exit()
    kou//=2
    #print(kou)
    ans=(m//kou+1)//2
    print(int(ans))
if __name__ == '__main__':
    main()
### BUGGY CODE ###

n=int(input())
L_lst=sorted(list(map(int,input().split())))
i=n-2
j=n-1
cnt=0
while j>1:
    x=0
    while x<i:
        if L_lst[i]+L_lst[x]>L_lst[j]:
            cnt+=i-x
            break
        else:
            x+=1
    i-=1
    if i==0 or (L_lst[j])//2 >= L_lst[i]:
        j-=1
        i=j-1
print(cnt)

### FIXED CODE ###

n=int(input())
L_lst=sorted(list(map(int,input().split())))
cnt=0
for j in range(n-1,1,-1):
    i=j-1
    x=0
    while x<i:
        if L_lst[i]+L_lst[x]>L_lst[j]:
            cnt+=i-x
            i-=1
        else:
            x+=1
print(cnt)