Harryxun/stf_run huggingface dataset:
def liner_search(n, l):
    for i in range(len(l)):
        if n <= l[i]:
            return i


N, X = map(int, input().split())
x = sorted(list(map(int, input().split())))
x.insert(liner_search(X, x), X)
sabun = [None] * N
for i in range(1, len(x)):
    sabun[i - 1] = x[i] - x[i - 1]
print(sorted(sabun)[0])


### FIXED CODE ###

from fractions import gcd


def liner_search(n, l):
    for i in range(len(l)):
        if n < l[i]:
            return i
    return len(l)


N, X = map(int, input().split())
x = sorted(list(map(int, input().split())))
x.insert(liner_search(X, x), X)
sabun = [None] * N
for i in range(1, len(x)):
    sabun[i - 1] = x[i] - x[i - 1]
res = gcd(0, sabun[0])
for i in range(1, len(sabun)):
    res = gcd(res, sabun[i])
print(res)
##B
N = int(input())
S = list(input() for i in range(N))
a=0
b=0
c=0
d=0
for i in S:
    if i =="AC":
        a +=1
    elif i =="WA":
        b +=1
    elif i =="TLE":
        c +=1
    elif i =="RE":
        d +=1
print("AC x "+ str(a))
print("WA x "+ str(b))
print("TLE x "+ str(c))
print("RE x "+ str(d))
AC x 3
WA x 1
TLE x 2
RE x 0

### FIXED CODE ###

##B
N = int(input())
S = list(input() for i in range(N))
a=0
b=0
c=0
d=0
for i in S:
    if i =="AC":
        a +=1
    elif i =="WA":
        b +=1
    elif i =="TLE":
        c +=1
    elif i =="RE":
        d +=1
print("AC x "+ str(a))
print("WA x "+ str(b))
print("TLE x "+ str(c))
print("RE x "+ str(d))
K, X = map(int, input().split())
2 for i in range(X - K + 1, X + K):
3 if i < X + K - 1:
4 print(i, end=' ')
5 else:
6 print(i)
1 K, X = map(int, input()

### FIXED CODE ###

a, b = map(int, input().split())
print(max([a+b,a-b,a*b]))
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[]
for i in range(1000001):
  table.append([True,0])
count=0
for i in range(0,n):
  pp=a[i]
  if table[pp][0]==True:
    if i==0:
      if a[i]!=a[i+1]:
        count+=1
    elif i==n-1:
      if a[i]!=a[i-1]:
        count+=1
    else:
      if a[i]!=a[i+1] and a[i]!=a[i-1]:
        count+=1
  if table[pp][1]==0:
    table[pp][1]=1
    for j in range(pp,1000001,pp):
      table[j][0]=False
      
print(count)
  

### FIXED CODE ###

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

a.sort()

table=[True]*1000001
count=0
if n==1:
  count=1
else:
  for i in range(0,n):
    pp=a[i]
    if table[pp]==True:
      if i==0:
        if pp!=a[i+1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      elif i==n-1:
        if pp!=a[n-2]:
          count+=1
      else:
        if pp!=a[i+1] and pp!=a[i-1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      
print(count)
A,B,X = map (int,input().split())
if A+B>=X and not A>X
	print "YES"
else
	print "NO"
  

### FIXED CODE ###

A,B,X = map (int,input().split())
if A+B>=X and not A>X :
	print ('YES')
else:
	print ('NO')
s = input()
t = input()
if s = t[:-1]:
	print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
t = input()
if s == t[:-1]:
	print("Yes")
else:
    print("No")
N = int(input())
v = list(map(int, input().split()))

v.sort()

for i in range(len(v)):
    if i==0:
        continue
    v.append((v[i-1]+v[i])/2)
    v.pop(i)
    v.pop(i-1)


print(v[0])

### FIXED CODE ###

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

v.sort()

for i in range(len(v)):
    if i==0:
        continue

    a = v.pop(1)
    b = v.pop(0)
    v.insert(0, (a+b)/2)


print(v[0])
N =int(input())
if N >=10 and N<=99:
  print(9)
elif N >=100 and N<=999:
  print(N-90)
elif N >= 1000 and N<= 9999:
  print(900)
elif N >= 10000 and N<= 99999:
  print(N-90-9000)
elif N = 100000:
  print(9 + 900 + 90000)
else:
  print(N)

### FIXED CODE ###

N =int(input())
if N >=10 and N<=99:
  print(9)
elif N >=100 and N<=999:
  print(N-90)
elif N >= 1000 and N<= 9999:
  print(9 + 900)
elif N >= 10000 and N<= 99999:
  print(N-90-9000)
elif N == 100000:
  print(9 + 900 + 90000)
else:
  print(N)
import heapq

n = int(input())
# n = 3

arr = [0]*n

pq = []
for i in range(n):
	arr[i] = int(input())
	heapq.heappush(pq, (-arr[i], i))
heapq.heapify(pq)
lg = heapq.heappop(pq)
slg = heapq.heappop(pq)
print(lg, slg)
lg, slg = lg[1], slg[1]

for i in range(n):
	if i==lg:
		print(arr[slg])
	else:
		print(arr[lg])

### FIXED CODE ###

n = int(input())

a = list(map(int, input().split()))
box = [0]*n
for i in range(n,0,-1):
    sum_box = 0
    for j in range(i,n+1,i):
        sum_box+=box[j-1]
    if sum_box%2!=a[i-1]:
        box[i-1]+=1
 
print(sum(box))
if sum(box):
    ans = []
    for i, x in enumerate(box):
        if x:
            ans.append(i+1)
    print(*ans)
#!/bin/env python3
from __future__ import division, print_function
try:
    input = raw_input
    range = xrange
except NameError:
    pass
# 上記のコードはPython2とPython3の違いを一部吸収するためのもの


def main():
    value = [0] * 1000
    weight = [0] * 1000
    casenum = 1
    while True:
        W = int(input())
        if(W == 0):
            return
        N = int(input())
        dp = [[0 for x in range(W+1)] for y in range(N+1)]
        for x in range(0, N):
            value[x], weight[x] = map(int, input().split(','))
        for i in range(0, N):
            for w in range(0, W+1):
                if w - weight[i] >= 0:
                    use = dp[i][w - weight[i]] + value[i]
                else:
                    use = 0
                unuse = dp[i][w]
                dp[i+1][w] = max(use, unuse)
        print("Case " + str(casenum) + ":")
        for w in range(W+1):
            if(dp[N][w] == dp[N][W]):
                print(str(dp[N][w]) + "\n" + str(w))
                break
        casenum += 1
main()

### FIXED CODE ###

#!/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import division, print_function
try:
    input = raw_input
    range = xrange
except NameError:
    pass
# 上記のコードはPython2とPython3の違いを一部吸収するためのもの


def main():
    value = [0] * 1000
    weight = [0] * 1000
    casenum = 1
    while True:
        W = int(input())
        if(W == 0):
            return
        N = int(input())
        dp = [[0 for x in range(W+1)] for y in range(N+1)]
        for x in range(0, N):
            value[x], weight[x] = map(int, input().split(','))
        for i in range(0, N):
            for w in range(0, W+1):
                if w - weight[i] >= 0:
                    use = dp[i][w - weight[i]] + value[i]
                else:
                    use = 0
                unuse = dp[i][w]
                dp[i+1][w] = max(use, unuse)
        print("Case " + str(casenum) + ":")
        for w in range(W+1):
            if(dp[N][w] == dp[N][W]):
                print(str(dp[N][w]) + "\n" + str(w))
                break
        casenum += 1
main()
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

println(e - a <= k ? "Yay!" : ":(")


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a<=k:
    print("Yay!")
else:
    print(":(")
N=int(input())
H=list(map(int,input().split()))
h=0
a=0
for i in range(N-1):
    h1=H[i+1]-H[i]
    if h1<-1:
        a=1
        break
    elif h1==-1:
        h2=H[i+2]-H[i+1]
        if h2<0:
            a=1
            break
if a==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N=int(input())
H=list(map(int,input().split()))
a=0
for i in range(N-1)[::-1]:
    if H[i]>H[i+1]:
        H[i]-=1
for i in range(N-1):
    if H[i]>H[i+1]:
        a=1
        break
if a==0:
    print("Yes")
else:
    print("No")
# https://atcoder.jp/contests/abc044/tasks/arc060_a
# ソートしてからごちゃごちゃやればどうにかなりそう(無理でした)

'''
解説満点解法1
もしもk枚選んだとき、合計がsになる通りの数がわかったら？→s=k*Aとなる場合の数の合計をすれば良い

k枚選んだとき、合計がsになる通りの数は典型的なDP！
dp(j,k,s)... X[0:j]からk枚選んで、その合計をsにするような選び方の総数
と定義すると、
dp(j+1,k,s) = X[j]を選んだ結果sになったときの通りの数 + X[j]を選ばずにsになっている通りの数 なので
dp(j+1,k,s) = dp(j,k-1,s-X[j]) + dp(j,k,s)

あとは初期条件と境界条件と伝播条件を付け加える。
境界条件 dp(j,k,0)=0 (数枚選んで合計が0になるのはありえない)
初期条件 dp(j,0,0)=1 (ただし、0枚選んだときは1通りとなる)(s-X[j]=0のときに1通りとなってほしいという気持ちもある)

伝播条件 s-X[j]<0に関しては dp(j-1,k-1,s-X[j])が必ず0通りとなる(ありえないので)
'''

import sys
read = sys.stdin.readline
from itertools import product


def read_ints():
    return list(map(int, read().split()))


N, A = read_ints()
X = read_ints()
S = sum(X)

# 満点解法1
dp = [[[0] * (S + 1) for _ in range(N + 1)] for _ in range(N + 1)]
for j in range(N + 1):  # 初期条件
    dp[j][0][0] = 1  # 1枚も選ばずに0になるのは1通り


for j, k, s in product(range(N), range(1, N + 1), range(S + 1)):
    dp[j + 1][k][s] = dp[j][k][s] + \
        (0 if s - X[j] < 0 else dp[j][k - 1][s - X[j]])

# s=k*Aとなるような通りの数の総数
ans = 0
for k in range(1, N + 1):  # 0個はとる通りの数はいらない
    ans += dp[N][k][k * A]

# print(dp)
print(ans)





### FIXED CODE ###

# https://atcoder.jp/contests/abc044/tasks/arc060_a
# ソートしてからごちゃごちゃやればどうにかなりそう(無理でした)

'''
解説満点解法1
もしもk枚選んだとき、合計がsになる通りの数がわかったら？→s=k*Aとなる場合の数の合計をすれば良い

k枚選んだとき、合計がsになる通りの数は典型的なDP！
dp(j,k,s)... X[0:j]からk枚選んで、その合計をsにするような選び方の総数
と定義すると、
dp(j+1,k,s) = X[j]を選んだ結果sになったときの通りの数 + X[j]を選ばずにsになっている通りの数 なので
dp(j+1,k,s) = dp(j,k-1,s-X[j]) + dp(j,k,s)

あとは初期条件と境界条件と伝播条件を付け加える。
境界条件 dp(j,k,0)=0 (数枚選んで合計が0になるのはありえない)
初期条件 dp(j,0,0)=1 (ただし、0枚選んだときは1通りとなる)(s-X[j]=0のときに1通りとなってほしいという気持ちもある)

伝播条件 s-X[j]<0に関しては dp(j-1,k-1,s-X[j])が必ず0通りとなる(ありえないので)
'''

import sys
read = sys.stdin.readline
from itertools import product


def read_ints():
    return list(map(int, read().split()))


N, A = read_ints()
X = read_ints()
S = sum(X)

# 満点解法1
dp = [[[0] * (S + 1) for _ in range(N + 1)] for _ in range(N + 1)]
for j in range(N + 1):  # 初期条件
    dp[j][0][0] = 1  # 1枚も選ばずに0になるのは1通り


for j, k, s in product(range(N), range(1, N + 1), range(S + 1)):
    dp[j + 1][k][s] = dp[j][k][s] + \
        (0 if s - X[j] < 0 else dp[j][k - 1][s - X[j]])

# s=k*Aとなるような通りの数の総数
ans = 0
for k in range(1, N + 1):  # 0個はとる通りの数はいらない
    s = k * A
    if s <= S:
        ans += dp[N][k][s]

# print(dp)
print(ans)


'''
満点解法2


'''
1
24 30

### FIXED CODE ###

n=int(input())
lr=[list(map(int,input().split())) for a in range(n)]
sum=0
for v in lr:
    sum+=v[1]-v[0]
print(sum+n)
import sys
input=sys.stdin.buffer.readline
mod=10**9+7
n=int(input())
d={}
z=0
from math import gcd 
for i in range(n):
    x,y=map(int,input().split())
    if x==y==0:z+=1
    else:
        f=gcd(x,y)
        x//=f;y//=f
        if x<0:x*=-1;y*=-1
        if x==0 and y<0:y=-y
        d[(x,y)]=1 if (x,y)not in d else d[(x,y)]+=1
ans=1
for (a,s) in d:
    if d[(a,s)]==0:continue
    ng=0
    if (s,-a)in d:ng+=d[(s,-a)];d[(s,-a)]=0
    if (-s,a)in d:ng+=d[(-s,a)];d[(-s,a)]=0
    ans*=(pow(2,d[(a,s)],mod)-1 + pow(2,ng,mod)-1 +1)%mod
    ans%=mod
    d[(a,s)]=0
print((ans+z-1)%mod)

### FIXED CODE ###

mod=10**9+7
n=int(input())
from collections import defaultdict
d=defaultdict(int)#各点の方向ベクトルを管理
z=0#原点にいる際は例外処理したいので別途数える
from math import gcd 
for i in range(n):
    x,y=map(int,input().split())
    if x==y==0:z+=1
    else:
        f=gcd(x,y)
        x//=f;y//=f#非本質な定数倍を削除
        if x<0:x*=-1;y*=-1#偏角は|theta|<=pi/2で十分
        if x==0 and y<0:y=-y
        d[(x,y)]+=1
ans=1
for (a,s) in d:
    if d[(a,s)]==0:continue#すでに数えた
    ng=0
    if (s,-a)in d:ng+=d[(s,-a)];d[(s,-a)]=0
    if (-s,a)in d:ng+=d[(-s,a)];d[(-s,a)]=0
    ans*=(pow(2,d[(a,s)],mod)-1 + pow(2,ng,mod)-1 +1)%mod
    #(a,s)を一本以上使う,ngを((a,s)と直交するもの)を一本以上使う,どちらも使わない
    ans%=mod
    d[(a,s)]=0
print((ans+z-1)%mod)#原点はそれ1つのみでしか使えない　+　1つも使わない例を除外
N, M = map(int, input().split())
H = list(map(int, input().split()))

root = dict()
if M == 1:
    print(N-1)

for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        root[A] = H[A-1]
        if B in root.keys():
            root.pop(root[B])
    elif H[A-1] < H[B-1]:
        root[B] = H[B - 1]
        if A in root.keys():
            root.pop(root[A])
    else:
        if B in root.keys():
            root.pop(root[B])
        if A in root.keys():
            root.pop(root[A])

print(len(root))

### FIXED CODE ###

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

H2 = copy.copy(H)
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        H2[B - 1] = False
    elif H[A - 1] < H[B - 1]:
        H2[A-1] = False
    else:
        H2[A - 1] = False
        H2[B - 1] = False

H3 = H2.count(False)

print(len(H) - H3)
# coding: utf-8
import sympy
n = int(input())
ans = 0
for i in range(n):
    ans = ans + (1 + i) * sympy.divisor_count(i+1)
print(ans)


### FIXED CODE ###

# coding: utf-8
n_input = int(input())
ans = 0
for i in range(1, n_input + 1):
    n = n_input // i
    ans += n * (1 + n) * i // 2
print(ans)
from collections import defaultdict
d = defaultdict(bool,False)
s = str(input().rstrip())
l=0
r=1
while(r<len(s)):
	if(d[s[l:r]]==False):
      d[s[l:r]]=True
      l=r
      r+=1      
    else:
      r+=1

ans=0
for key,val in d.items():
  if(val==True):ans+=1

print(ans)

### FIXED CODE ###

s = str(input().rstrip())
l=0
r=1
tmp =''
li = list()
while(r<=len(s)):
  if(s[l:r]!=tmp):
    li.append(s[l:r])
    tmp=s[l:r]
    l=r
    r+=1      
  else:
    r+=1

print(len(li))
from collections import Counter
N=int(input())
D=list(map(int, input().split() ))
d=dict(Counter(D))
p=998244353
#print(d)
maxi=max(d)

mini=float("inf")
ans=1
if D[0]!=0:
  print(0)
else:
  if d[0]!=1:
    print(0)
  else:
    for i in range(1,maxi+1):
      mini=min(mini,d[i])
      if i not in d:
        print(0)
        exit()
      else:
        s =  (d[i-1]**d[i])%p
        ans = (ans * s)%p
    print(ans)
    print(mini)

### FIXED CODE ###

from collections import Counter
N=int(input())
D=list(map(int, input().split() ))
d=dict(Counter(D))
p=998244353
#print(d)
maxi=max(d)

ans=1
if D[0]!=0:
  print(0)
else:
  if d[0]!=1:
    print(0)
  else:
    for i in range(1,maxi+1):
      if i not in d:
        print(0)
        exit()
      else:
        s =  (d[i-1]**d[i])%p
        ans = (ans * s)%p
    print(ans)
import numpy as np
n = int(input())
a = [int(x) for x in input()]
print(np.amax(abs(np.subtract.outer(a, a))))


### FIXED CODE ###

# ABC102B

import numpy as np
n = int(input())
a = [int(x) for x in input().split()]
print(np.amax(abs(np.subtract.outer(a, a))))
x,y=map(int,input().split())

ans=abs(x)-abs(y)

if ans==0:
    if x==y:
        print(ans)
    else:
        print(1)
elif ans<0:
    if x<0 and y<0 :
        print(ans+2)
    else:
        print(ans)
else:
    if x<=0 and y=<0:
        print(abs(ans))
    elif 0<x and 0<y:
        print(abs(ans)+2)
    else: 
        print(abs(ans)+1)



### FIXED CODE ###

x,y=map(int,input().split())

ans=abs(x)-abs(y)
#print(ans)
if ans==0:
    if x==y:
        print(ans)
    else:
        print(1)
elif ans<0:
   # print("SDFGH")
    if x<0 and y<0 :
        print(abs(ans)+2)
    elif 0<=x and 0<=y:
        print(abs(ans))
    else:
        print(abs(ans)+1)
else:
    if x<=0 and y<=0:
        print(abs(ans))
    elif 0<x and 0<y:
        print(abs(ans)+2)
    else: 
        
        print(abs(ans)+1)
n, m = [int(i) for i in input().split()]

if n >= 2 * m:
    print(m // 2)
else:
    print(n + (m - 2 * n) // 2)
n, m = [int(i) for i in input().split()]

if n >= 2 * m:
    print(m // 2)
else:
    print(n + (m - 2 * n) // 4)


### FIXED CODE ###

n, m = [int(i) for i in input().split()]

if 2*n >= m:
    print(m // 2)
else:
    print(n + (m - 2 * n) // 4)
N = int(input())
li = list(map(int, input().split()))
ans = dict()
for i in range(len(li)):
    ans[li[i]] = i + 1
ali = []
for j in sorted(ans.keys()):
    ali.append(ans[j])
print(*join(ali))

### FIXED CODE ###

N = int(input())
li = list(map(int, input().split()))
ans = dict()
for i in range(len(li)):
    ans[li[i]] = i + 1
ali = []
for j in sorted(ans.keys()):
    ali.append(ans[j])
print(*ali)
import math

n=int(input())
A=list(map(int, input().split()))
L=[0]*2*n
R=[0]*2*n
c=0
x=0
for i,a in enumerate(A):
  L[i+a]+=1
  R[i-a]+=1
  c+=L[i-a]

print(c)


### FIXED CODE ###

n=int(input())
A=list(map(int, input().split()))
d={}
c=0

for i,a in enumerate(A):
  if i+a not in d:
    d[i+a]=1
  else:
    d[i+a]+=1
  if i-a in d:
    c+=d[i-a]

print(c)
N = input()

if N{[-1]==2or 4or 5or 7or 9:
     print('hon')
     
     elif N[-1]==0or 1or 6or 8:
     print('pon')
     
     else:
     print('bon')

### FIXED CODE ###

N = input()
 
if N[-1]=='2' or N[-1]=='4' or N[-1]=='5' or N[-1]=='7' or N[-1]=='9':
    print('hon')
     
elif N[-1]=='0' or N[-1]=='1' or N[-1]=='6' or N[-1]=='8':
    print('pon')
     
else:
    print('bon')
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
count=o
while count<c:
  for i in range(100,0):
    if a%i==0 and b%i==0:
      count=count+1
print(i)

### FIXED CODE ###

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
d=0
if a>=b:
  for i in range(101):
    if a%(b-i)==0 and b%(b-i)==0:
      d=d+1
      if d==c:
        print(b-i)
        break
if a<b:
  for i in range(101):
    if a%(a-i)==0 and b%(a-i)==0:
      d=d+1
      if d==c:
        print(a-i)
        break
n=int(input())

print(r**2)


### FIXED CODE ###

r=int(input())

print(r**2)
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
n = N
divs = []
a = 1
b = N


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


Ps = primes(10 ** 6)
Ps.reverse()

for P in Ps:
    x, y = divmod(n, P)
    while y == 0:
        n = x
        divs.append(P)
        x, y = divmod(n, P)
if divs == [] or len(divs) == 1:
    print(N - 1)
    exit()
else:
    length = len(divs)
    for i in range(2 ** length):
        a1 = 1
        s = format(i, '030b')
        for j in range(length):
            #print("s[-j-1]:" + s[-j - 1])
            #print("divs[j]:" + str(divs[j]))
            if s[-j - 1] == '1':
                a1 = a1 * divs[j]
                #print("divs[j]" + str(divs[j]))
                #print("a1:" + str(a1))
        b1 = N // a1
        #print("a1:" + str(a1))
        if a1 + b1 < a + b:
            a = a1
            b = b1
# print(divs)
#print("str:" + s)
print(a+b-2)


### FIXED CODE ###

N = int(input())
ans = N-1
for i in range(int(N ** 0.5), 1, -1):
    x, y = divmod(N, i)
    if y == 0:
        print(i+x-2)
        exit()
print(ans)
import sys
b=0
a=[{},{}]
for e in sys.stdin:
 if'\n'==e:b=1
 else:c=int(e.split(',')[0])
  if c in a[b]:a[b][c]+=1
  else:a[b][c]=1
for k in sorted({*a[0]}&{*a[1]}):print(k,a[0][k]+a[1][k])


### FIXED CODE ###

import sys
b=0
a=[{},{}]
for e in sys.stdin:
 if'\n'==e:b=1
 else:c,_=e.split(',');c=int(c);a[b].setdefault(c,0);a[b][c]+=1
for k in sorted({*a[0]}&{*a[1]}):print(k,a[0][k]+a[1][k])
n=int(input())
s=input()
ans=0
 
for i in range(1, n):
    a=s[:i]
    b=s[i:]
    dic=[]
    dic2=[]
    for j in range(len(a)):
        if a[j] not in dic:
            dic.append(a[j])
    for k in range(len(b)):
        if b[k] not in dic2:
            dic2.append(b[k])
 
    for i in range(len(dic)):
        if dic[i] in dic2:
            cnt+=1
    ans=max(ans, cnt)
    
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
ans=0

for i in range(1, n):
    a=s[:i]
    b=s[i:]
    dic=[]
    dic2=[]
    for j in range(len(a)):
        if a[j] not in dic:
            dic.append(a[j])
    for k in range(len(b)):
        if b[k] not in dic2:
            dic2.append(b[k])

    l=min(len(dic), len(dic2))
    cnt=0
    if l==len(dic):
        for j in range(len(dic)):
            if dic[j] in dic2:
                cnt+=1
    else:
        for k in range(len(dic2)):
            if dic2[k] in dic:
                cnt+=1
    
    ans=max(ans, cnt)
    
print(ans)
def d2_add(a):
    w = len(a[0])
    h = len(a)
    da = [[0] * w for j in range(h)]
    da[0][0] = a[0][0]
    for i in range(1, w):
        da[0][i] = da[0][i - 1] + a[0][i]
    for i in range(1, h):
        cnt_w = 0
        for j in range(w):
            cnt_w += a[i][j]
            da[i][j] = da[i - 1][j] + cnt_w
    return da

def d2_calc(da, p, q, x, y):
    if p > x or q > y:  return 0
    if p == 0 and q == 0:  return da[x][y]
    if p == 0:  return da[x][y] - da[x][q - 1]
    if q == 0:  return da[x][y] - da[p - 1][y]
    return da[x][y] - da[p - 1][y] - da[x][q - 1] + da[p - 1][q - 1]

N, M, Q = cin()
v = [[0 for _ in range(N)] for _ in range(N)]
p = [[0 for _ in range(2)] for _ in range(N)]

for i in range(M):
    a, b = cin()
    v[a - 1][b - 1] += 1;

for i in range(Q):
    a, b = cin()
    p[i][0] = a - 1;
    p[i][1] = b - 1;

res = d2_add(v);

for i in range(Q):
    ans = d2_calc(res, p[i][0], p[i][0], p[i][1], p[i][1]);
    print(ans)

### FIXED CODE ###

N, M, Q = list(map(int,input().split()))
L = []
R = []
for i in range(M):
    in1, in2 = map(int,input().split())
    L.append(in1 - 1)
    R.append(in2 - 1)
p = []
q = []
for i in range(Q):
    in1, in2 = map(int,input().split())
    p.append(in1 - 1)
    q.append(in2 - 1)
    
a = [[0 for _ in range(N)] for _ in range(N)]
for i in range(M):
    a[L[i]][R[i]] += 1
    
#da[i][j]:(0,0)~(i,j)の長方形の和
def da_gen(a):
    w = len(a[0])
    h = len(a)
    da = [[0] * w for j in range(h)]
    da[0][0] = a[0][0]
    for i in range(1, w):
        da[0][i] = da[0][i - 1] + a[0][i]
    for i in range(1,h):
        cnt_w = 0
        for j in range(w):
            cnt_w += a[i][j]
            da[i][j] = da[i - 1][j] + cnt_w
    return da

#da_calc(p,q,x,y):(p,q)~(x,y)の長方形の和
def da_calc(da, p, q, x, y):
    if p > x or q > y:
        return 0
    if p == 0 and q == 0:
        return da[x][y]
    if p == 0:
        return da[x][y] - da[x][q - 1]
    if q == 0:
        return da[x][y] - da[p - 1][y]
    return da[x][y] - da[p - 1][y] - da[x][q - 1]+da[p - 1][q - 1]

ret = da_gen(a)
for i in range(Q):
    ans = da_calc(ret, p[i], p[i], q[i], q[i])
    print(ans)
n=int(input())
ans=0
for i in range(n):
    if i%3!=0 and i%5=!=0:
        ans+=i:
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(n+1):
    if i%3!=0 and i%5!=0:
        ans+=i
print(ans)
N, M = map(int, input().split())
A = [int(x) for x in input().split()]

f = {
    1: 2,
    2: 5,
    3: 5,
    4: 4,
    5: 5,
    6: 6,
    7: 3,
    8: 7,
    9: 6
}
A = sorted(A, reverse=True)

dp = [float('-inf')] * (N + 1)
dp[0] = 0
for i in range(N + 1):
    for a in A:
        if i - f[a] >= 0:
            dp[i] = max(dp[i], dp[i - f[a]] + 1)

ans = ''
num, digit = N, dp[N]
while num > 0:
    for a in A:
        if dp[num - f[a]] == digit - 1:
            ans += str(a)
            num -= f[a]
            digit -= 1
            break
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
A = [int(x) for x in input().split()]

f = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
A = sorted(A, reverse=True)

dp = [float('-inf')] * (N + 1)
dp[0] = 0
for i in range(N + 1):
    for a in A:
        if i - f[a] >= 0:
            dp[i] = max(dp[i], dp[i - f[a]] + 1)

ans = ''
num, digit = N, dp[N]
while num > 0:
    for a in A:
        i = num - f[a]
        if i >= 0 and dp[i] == digit - 1:
            ans += str(a)
            num -= f[a]
            digit -= 1
            break
print(ans)
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

b_li = [0]
b_ = 0

for B_ in B:
    b_ = b_ + B_
    b_li.append(b_)

book_max = 0
book_cnt_a = 0
book_cnt_ab = 0
a_ = 0
book_cnt_ab = M

for i in range(N+1):
    while (b_li[book_cnt_ab-1] + a_) > K:
        book_cnt_ab = book_cnt_ab - 1
    if (book_max <= book_cnt_ab + book_cnt_a):
            book_max = book_cnt_ab + book_cnt_a
    book_cnt_a = book_cnt_a + 1
    if i >= N: break
    a_ = a_ + A[i]

print(book_max)


### FIXED CODE ###

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

Asum_li = [0]
Asum = 0
Bsum_li = [0]
Bsum = 0

for A_ in A:
    Asum = Asum + A_
    Asum_li.append(Asum)

for B_ in B:
    Bsum = Bsum + B_
    Bsum_li.append(Bsum)

cnt_max = 0
cnt_b = M

for cnt_a in range(N+1):

    if Asum_li[cnt_a] > K : break

    while (Bsum_li[cnt_b] + Asum_li[cnt_a]) > K:
        cnt_b = cnt_b - 1
        if cnt_b < 0: break

    if (cnt_max < cnt_a + cnt_b): cnt_max = cnt_a + cnt_b


print(cnt_max)