Harryxun/stf_run huggingface dataset:
n = int(input())

L = [int(i) for i in input().split()]

Answer = int(0)
for i in range(n-2):
     if L[i]<L[i+1] and L[i+1]<L[i+2]:
             Answer = Answer +1
             continue
	print(Answer)


### FIXED CODE ###

n = int(input())

L = [int(i) for i in input().split()]

Answer = int(0)
for i in range(n-2):
     if L[i]<L[i+1] and L[i+1]<L[i+2]:
             Answer = Answer + 1
             continue
     if L[i+2]<L[i+1] and L[i+1]<L[i]:
             Answer = Answer + 1
             continue
print(Answer)
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7

if N - A.count(0) < K:
    print(0)
    exit(0)

plus = []
minus = []
for a in A:
    if a >= 0:
        plus.append(a)
    else:
        minus.append(a)

plus.sort()
lenMinus = len(minus)

if K % 2 == 1 and len(plus) == 0:
    minus.sort(reverse=True)
    ans = 1
    for i in range(K):
        ans *= minus[i]
        ans %= MOD
    print(ans)
    exit(0)

minus.sort()

i = 0
j = 0

ans = 1
if K % 2 == 1:
    ans = plus[0]
    K -= 1
    plus = plus[1:]

for _ in range(K//2):
    if i+1 >= len(plus):
        ans *= (minus[j] * minus[j+1])
        ans %= MOD
        j += 2
        continue
    elif j+1 >= len(minus):
        ans *= (plus[i] * plus[i+1])
        ans %= MOD
        i += 2
        continue

    a = plus[i] * plus[i+1]
    b = minus[j] * minus[j+1]
    if a > b:
        ans *= a
        i += 2
    else:
        ans *= b
        j += 2
    ans %= MOD

print(ans)


### FIXED CODE ###

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

ans = 1
if N == K:
    for a in A:
        ans *= a
        ans %= MOD
    print(ans)
    exit(0)

if N - A.count(0) < K:
    print(0)
    exit(0)

plus = []
minus = []
for a in A:
    if a > 0:
        plus.append(a)
    else:
        minus.append(a)

if K % 2 == 1 and len(plus) == 0:
    minus.sort(reverse=True)
    for i in range(K):
        ans *= minus[i]
        ans %= MOD
    print(ans)
    exit(0)

plus.sort(reverse=True)
minus.sort()

if len(minus) == 0:
    for k in range(K):
        ans *= plus[k]
        ans %= MOD
    print(ans)
    exit(0)

i = 0
j = 0

if K % 2 == 1:
    ans = plus[0]
    K -= 1
    plus = plus[1:]

for _ in range(K//2):
    if i+1 >= len(plus):
        ans *= (minus[j] * minus[j+1])
        ans %= MOD
        j += 2
        continue
    elif j+1 >= len(minus):
        ans *= (plus[i] * plus[i+1])
        ans %= MOD
        i += 2
        continue

    a = plus[i] * plus[i+1]
    b = minus[j] * minus[j+1]
    if a > b:
        ans *= a
        i += 2
    else:
        ans *= b
        j += 2
    ans %= MOD

print(ans)
print(eval(input().translate({46:'',32:42}))//100)

### FIXED CODE ###

a,b=input().split();print(int(a)*int(b[0]+b[-2:])//100)
import operator
for e in iter(input,'0'):
    target = [[*map(int,input().split())]for _ in[0]*int(e)]
    bx, by = min(target)
    target = {(x - bx, y - by) for x, y in target}
    max_tx = max(map(operator.itemgetter(0), target))
    b = {tuple(map(int,input().split()))for _ in[0]*int(input())}
    max_sx = max(map(operator.itemgetter(0), b))
    lim_x = max_sx - max_tx
    for x,y in b:
        if x > lim_x:continue
        for u,v in a:
            if (x + tx, y + ty) not in b:break
        else:
            print(x - bx, y - by)
            break


### FIXED CODE ###

for e in iter(input,'0'):
 a=[[*map(int,input().split())]for _ in[0]*int(e)]
 s,t=min(a)
 b={tuple(map(int,input().split()))for _ in[0]*int(input())}
 m=max(b)[0]-max(a)[0]+s
 for x,y in b:
  if x<=m:
   for u,v in a:
    if(x+u-s,y+v-t)not in b:break
   else:print(x-s,y-t);break
n=int(input())
s=''
while n!=0:
  s=str(n%2)+s
  n=-(n//2)
print(s*(s!='')else 0)

### FIXED CODE ###

n=int(input())
s=''
while n!=0:
  s=str(n%2)+s
  n=-(n//2)
print(s*(s!='')or 0)
import sys
imput = sys.stdin.readline

import numpy as np

def main():
    N, M, Q = map(int, input().split())
    I = [list(map(int, input().split())) for _ in range(Q)]
    A = np.array([M] * N)
    ans = []
    
    j = 1
    while True:
        if A[-1] == 1:
            break
        
        tmp = 0
        for i in I:
            a, b, c, d = i
            tmp += d if A[b-1] - A[a-1] == c else 0

        ans.append(tmp)

        if A[0] == 1:
            n = A[j]
            A[:j+1] = n - 1
            if n - 1 == 1:
                j += 1
        else:
            A[0] -= 1
            
    print(max(ans))    


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

from itertools import combinations_with_replacement as cwr

def main():
    N, M, Q = map(int, input().split())
    I = [list(map(int, input().split())) for _ in range(Q)]
    J = cwr(range(1, M+1), N)
    ans = []

    for j in J:
        tmp = 0
        for i in I:
            a, b, c, d = i
            tmp += d if j[b-1] - j[a-1] == c else 0
        ans.append(tmp)

    print(max(ans))

    
if __name__  == '__main__':
    main()
M,D= int(input().split())
# print(M,D)

count = 0
for ii in range(1,M+1):
    
    for i in range (22, D + 1):
        #print(i)
        d1 = i % 10
        d2 = i // 10
        
        if d1 < 2 or d2 < 2:
            continue
        
        if ii == d1 * d2:
            count = count + 1
        
        

print(count)

### FIXED CODE ###

M,D=map(int,input().split())
# print(M,D)
 
count = 0
for ii in range(1,M+1):
    
    for i in range (22, D + 1):
        #print(i)
        d1 = i % 10
        d2 = i // 10
        
        if d1 < 2 or d2 < 2:
            continue
        
        if ii == d1 * d2:
            count = count + 1
        
        
 
print(count)
n = input()
a = [int(ocu) for ocu in input().rstrip().split()]

paired_a = zip(range(1, n+1), a)

paired_a.sort(lambda x:x[1])

print(" ".join([pair[0] for pair in paired_a]))

### FIXED CODE ###

n = int(input())
a = [int(ocu) for ocu in input().rstrip().split()]

paired_a = list(zip(range(1, n+1), a))

paired_a.sort(key=lambda x:x[1])

print(" ".join([str(pair[0]) for pair in paired_a]))
import numpy as np

N ,M= map(int,input().split())
n0 = 2**int(np.ceil(np.log2(2*N - 1)))

A = np.zeros(n0)
B=np.zeros(n0)
l=list(map(int,input().split()))

for i in range(N):
    A[i]=l[i]
    B[i]=l[i]

C = np.fft.ifft( np.fft.fft(A)*np.fft.fft(B) )
ans=0
j=1
q=[]
for ci in np.real(C[:2*N - 1] + 0.5):
    #ans+=int(ci)*j
    q.append([int(ci),j])
    j+=1
q.reverse()
z=0
j=0
while z<M:
    ans+=q[j][0]*q[j][1]
    j+=1
    z+=q[j][0]
ans-=(z-M)*q[j][1]
print(ans)


### FIXED CODE ###

import numpy as np

N ,M= map(int,input().split())
l=list(map(int,input().split()))
n0 = 2**int(np.ceil(np.log2(2*(max(l))-1)))

A = np.zeros(n0)
#B=np.zeros(n0)
#l=list(map(int,input().split()))

for i in range(N):
    A[l[i]-1]+=1
   # B[i]=l[i]

C = np.fft.ifft( np.fft.fft(A)*np.fft.fft(A) )
ans=0
j=2
q=[]
for ci in np.real(C[:2*(max(l))-1] + 0.5):
    #ans+=int(ci)*j
    q.append([int(ci),j])
    j+=1
q.reverse()
#print(q)
z=0
j=0
while z<M:
    ans+=q[j][0]*q[j][1]
    z+=q[j][0]
    j+=1
ans-=(z-M)*q[j-1][1]
print(ans)
H,W,K = [int(i) for i in input().split()]

DP = [[0 for i in range(W)]for j in range(2)]

t = [0 for i in range(W+10)]

t[1] = 1
t[2] = 2
for i in range(2,W+8):
    t[i+1] = t[i] + t[i-1]

#print(t)
n = 0
DP[0][0] = 1
for i in range(H):
    if W == 1:
        break
    DP[not(n)][0] = (DP[n][0] * t[W-1] + DP[n][1] * t[W-2]) % 1000000007
    for i in range(1,W-1):
        DP[not(n)][i] =( DP[n][i-1] *t[W - (i+1)] + DP[n][i]*(t[i-1] + t[W-i]) + DP[n][i+1]*t[i-2] ) % 1000000007
    
    DP[not(n)][W-1] = (DP[n][W-2]*t[W-2] + DP[n][W-1] * t[W-1]) % 1000000007
    n = not(n)
print(DP[n][K])


### FIXED CODE ###

H,W,K = [int(i) for i in input().split()]

DP = [[0 for i in range(W)]for j in range(2)]

t = [0 for i in range(W+10)]
t[0]  = 1
t[1] = 1
t[2] = 2
for i in range(2,W+8):
    t[i+1] = t[i] + t[i-1]

#print(t)
n = 0
DP[0][0] = 1
for i in range(H):
    if W == 1:
        break
    DP[not(n)][0] = (DP[n][0] * t[W-1] + DP[n][1] * t[W-2]) % 1000000007
    for i in range(1,W-1):
        DP[not(n)][i] =( DP[n][i-1] *(t[W-i-1] * t[i-1]) + DP[n][i] * (t[i] * t[W-i-1]) + DP[n][i+1]*(t[W-i-2] * t[i])) % 1000000007
    
    DP[not(n)][W-1] = (DP[n][W-2]*t[W-2] + DP[n][W-1] * t[W-1]) % 1000000007
    n = not(n)
print(DP[n][K-1])
N , X = map(int,input().split())
L = list(input())
cnt = 1
b = 0
lst = list()
for i in range(N):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N):
    b += lst[j]
    cnt += 1

    if b+lst[j+1] > X :
        break
    if cnt >= N:
        break
print(cnt)


### FIXED CODE ###

N , X = map(int,input().split())
L=list(map(int,input().split()))
b = 0
cnt = 1
for i in range(N):
    b += L[i]
    if b <= X   :
        cnt+=1
    else:
        break
print(cnt)
x,y = map(int,input().split())

import math

a = x+y

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)

if a % 3 != 0:
    print(0)

else:
    c = int(x% (a/3))
    b = a/3 -c

    d = math.factorial(a/3) /(math.factorial(b)*math.factorial(c))
    print(d%(10**9 +7))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x,y=mii()

if (x+y) %3!=0:
    print(0)
    exit()
if max(x,y)/min(x,y)>2:
    print(0)
    exit()

def nCk(n, k, mod=10 ** 9 + 7):
    if n < k:
        return 0
    k = min(k, n - k)
    numer = 1
    for x in range(n - k + 1, n + 1):
        numer = (numer * x) % mod
    denom = 1
    for x in range(1, k + 1):
        denom = (denom * x) % mod
    return numer * pow(denom, mod - 2, mod) % mod

n=(2*y-x)//3
m=(2*x-y)//3

print(nCk(n+m,n,mod))
n,m=map(int,input().split())
mat=[]
dx=[0,0,-1,1]
dy=[1,-1,0,0]
for i in range(n):
    mat.append(list(input()))
f=0 
for i in range(n):
    if f:
        break 
    for j in range(n):
        if mat[i][j]=='#':
            q=[[i,j]]
            f=1 
            vis=[[0 for j in range(m)]for i in range(n)]
            vis[i][j]=1 
            while q:
                t=q.pop(0)
                x,y=t[0],t[1] 
                for k in range(4): 
                    if 0<=x+dx[k]<n and 0<=y+dy[k]<m and vis[x+dx[k]][y+dy[k]]==0: 
                        vis[x+dx[k]][y+dy[k]]=1 
                        q.append([x+dx[k],y+dy[k]])
            break 
for i in range(n):
    for j in range(m): 
        if vis[i][j]==0 and mat[i][j]=='#':
           # print(i,j)
            print('No')
            exit()
print('Yes')

### FIXED CODE ###

n,m=map(int,input().split())
mat=[]
dx=[0,0,-1,1]
dy=[1,-1,0,0]
for i in range(n):
    mat.append(list(input().strip()))
f=0 
for i in range(n):
    for j in range(m):
        if mat[i][j]=='#':
            f=0 
            for k in range(4): 
                if 0<=i+dx[k]<n and 0<=j+dy[k]<m and mat[i+dx[k]][j+dy[k]]=='#': 
                    f=1  
            if not f:
                print('No')
                exit()
print('Yes')
N = int(input())
*A, = map(int,input().split())
q = []
for a in A[:N]:
    heapq.heappush(q,a)
S1 = [sum(q)]
for a in A[N:N*2]:
    if a>q[0]:
        S1.append(S1[-1] + a - q[0])
        heapq.heapreplace(q,a)
    else:
        S1.append(S1[-1])
q = []
for a in A[2*N:]:
    heapq.heappush(q,-a)
S2 = [sum(q)]
for a in A[N:N*2][::-1]:
    if a<-q[0]:
        S2.append(S2[-1] - a - q[0])
        heapq.heapreplace(q,-a)
    else:
        S2.append(S2[-1])
S2 = S2[::-1]
print(max(map(sum,zip(S1,S2))))

### FIXED CODE ###

import heapq
N = int(input())
*A, = map(int,input().split())
q = []
for a in A[:N]:
    heapq.heappush(q,a)
S1 = [sum(q)]
for a in A[N:N*2]:
    if a>q[0]:
        S1.append(S1[-1] + a - q[0])
        heapq.heapreplace(q,a)
    else:
        S1.append(S1[-1])
q = []
for a in A[2*N:]:
    heapq.heappush(q,-a)
S2 = [sum(q)]
for a in A[N:N*2][::-1]:
    if a<-q[0]:
        S2.append(S2[-1] - a - q[0])
        heapq.heapreplace(q,-a)
    else:
        S2.append(S2[-1])
S2 = S2[::-1]
print(max(map(sum,zip(S1,S2))))
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[a[i]-1] += 1
for i in ans:
    print(i)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = Counter(list(map(int,input().split())))
for i in range(1,n+1):
    print(a[i])
import math
k = int(input())+1
for i in range(1, k):
    for j in range(1, k):
        temp = math.gcd(i, j)
        for x in range(1, k):
            sum += math.gcd(temp, x)
print(sum)

### FIXED CODE ###

import math
sum = 0
k = int(input())+1
for i in range(1, k):
    for j in range(1, k):
        temp = math.gcd(i, j)
        for x in range(1, k):
            sum += math.gcd(temp, x)
print(sum)
a,b=map(int.input(),split())
if a-b＊2<0:
 print(0)
else:
 print(a-b＊2)
  


### FIXED CODE ###

a,b=map(int,input().split())
if a-b*2<=0:
  
  print(0)
else:
  print(a-b*2)
n=str(input())
if str="ABC":
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

n=str(input())
if n=="ABC":
  print("ARC")
else:
  print("ABC")
import sympy
N = int(input())

total =  0
for i in range(1,N+1):
    a = i * len(sympy.divisors(i))
    total += a
print(total)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1): #各iについて、i*(1～n//iまでの総和)を足し合わせればよい
 k=n//i
 ans+=i*(k*(k+1)//2)
print(ans)
a,b,c = map(string,input().split())
if a[-1] == b[0] and b[-1] == c[0]:
  print('YES')
else :
  print('NO')

### FIXED CODE ###

a,b,c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
  print('YES')
else :
  print('NO')
import numpy as np
argList = list(map(int, input().split())) 
heights = list(map(int, input().split())) 

#いい展望台フラグ
check = np.array([1]*argList[0])

for n in range(argList[0]-1):
    #どことどこをつないでいるか
    con = list(map(int, input().split())) 
    #print(con)
    #低かったらいい展望台ではない
    if heights[con[0]-1] < heights[con[1]-1]:
        check[con[0]] = 0
    else:
        check[con[1]] = 0
print(np.sum(check))

### FIXED CODE ###

import numpy as np
argList = list(map(int, input().split())) 
heights = list(map(int, input().split())) 

#いい展望台フラグ
check = np.array([1]*argList[0])

for n in range(argList[1]):
    #どことどこをつないでいるか
    con = list(map(int, input().split())) 
    #低かったらいい展望台ではない
    if heights[con[0]-1] <= heights[con[1]-1]:
        check[con[0]-1] = 0
    if heights[con[0]-1] >= heights[con[1]-1]:
        check[con[1]-1] = 0
print(np.sum(check))
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    s.pop(0)
    s.pop(s.index("C"))
    if s != s.lower():
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

### FIXED CODE ###

def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    num = s.index("C")
    s = s[1:num] + s[num+1:]
    if s != s.lower():
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])
k = input()
if k[0] == k[1] or k[1] ==k[2] or k[2]==k[0] in str(N):
    print("Yes")
else:
    print("No")
   

### FIXED CODE ###

N = input()
if '7' in str(N):
    print('Yes')
else:
    print('No')
N,M=map(int,input().split())
d=[]
for i in range(1,int(M**0.5+1)):
  if M%i == 0:
    d.extend(i,M//i)
d=list(set(d)).sort()
for x in d:
  if x>=N:
    print(M//x)
    break


### FIXED CODE ###

N,M=map(int,input().split())
d=[]
for i in range(1,int(M**0.5+1)):
  if M%i == 0:
    d. append(i)
    d.append(M//i)
dd=list(set(d))
dd.sort()
for x in dd:
  if x>=N:
    print(M//x)
    break
l="abcdefghijklmnopqrstuvwxy"
print(l[l.index(input())+1])

### FIXED CODE ###

l="abcdefghijklmnopqrstuvwxyz"
print(l[l.index(input())+1])
r=int(input())
R-r*r
print(R)

### FIXED CODE ###

r=int(input())
R=r*r
print(R)
N = int(input())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

out = 0
out += sum(B_list)
print("out", out)

a_prev = 0

for index, a in enumerate(A_list):
    print(index, a, a_prev)
    if a_prev == 0:
        a_prev = 0
    elif a - a_prev == 1:
        out += C_list[index]
    a_prev = a
    
print(out)

### FIXED CODE ###

N = int(input())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

out = 0
out += sum(B_list)
a_prev = 0

for index, a in enumerate(A_list):
    if a_prev == 0:
        a_prev = 0
    elif a - a_prev == 1:
        out += C_list[a-2]
    a_prev = a
    
print(out)
n,t=map(int,input().split())
s=[list(map(int,input().split())) for _ in range(n)]

dp=[[0]*(t) for i in range(n)]
x=[[0]*(t) for j in range(n)]
s.sort()


p=s[-1]
del(s[-1])


for i in range(n-1):
    for j in range(t):

        if j-s[i][0]>=0:
            dp[i+1][j]=max(dp[i][j],dp[i][j-s[i][0]]+s[i][1])
            if dp[i+1][j]>dp[i][j]:
                x[i+1][j]=str(x[i][j-s[i][0]])+str(i)
            else:
                x[i+1][j]=x[i][j]

        else:
            dp[i+1][j]=dp[i][j]
            x[i+1][j]=x[i][j]
count=0

v=[]
for i in x[n-1][-1]:
    count+=1
    if count==1:
        continue
    v.append(int(i))


ans=p[1]
for i in range(n-1):
    if len(v)!=0 and v[0]==i:
        del(v[0])
        continue

    ans=max(ans,s[i][1])



print(dp[n-1][-1]+ans)




         


        




### FIXED CODE ###

n,t=map(int,input().split())
s=[list(map(int,input().split())) for _ in range(n)]

dp=[[0]*(t) for i in range(n+1)]
s.sort()


for i in range(n):
    for j in range(t):
        if j-s[i][0]>=0:
            dp[i+1][j]=max(dp[i][j],dp[i][j-s[i][0]]+s[i][1])

        else:
            dp[i+1][j]=dp[i][j]

ans=0
for i in range(n):
    ans=max(ans,dp[i][t-1]+s[i][1])

print(ans)
import sys

def gcd(x, y, *val):
    val = [x, y] + list(val)
    val.sort(reverse=True)

    if len(val) == 2:
        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, len(val), 2)], val[-1])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    for i in range(num):
        mem = input.pop(num - 1 - i)
        gcd_max = max(gcd_max, gcd(*input, *input_mem))
        input_mem.append(mem)

    print(gcd_max)



if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def gcd(x, y, *val):
    val = sorted([x, y], reverse=True) + list(val)
    count = len(val)

    if count == 2:
        if val[1] == 0:
            return val[0]

        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        if count % 2 == 1:
            val.append(val[-1])

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, count, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    if num == 2:
        print(max(input))
        return

    gcd_left = [0]
    gcd_right = [0]

    for i in range(num - 1):
        gcd_left.append(gcd(input[i], gcd_left[i]))
        gcd_right.append(gcd(input[-1 - i], gcd_right[i]))

    gcd_right.reverse()
    gcd_list = []

    for i in range(num):
        gcd_list.append(gcd(gcd_left[i], gcd_right[i]))

    print(max(gcd_list))



if __name__ == "__main__":
    main()
num = int(input())
li = list(input())
ans = 0
for i in range(num):
  fi = set(li[:i])
  se = set(li[i:])
  hoge = len(list(fi & se))
  if hoge > ans:
    ans = hoge
 
print(ans)

### FIXED CODE ###

li = list(map(int,input().split()))
ans = [li[0]+li[1],li[0]-li[1],li[0]*li[1]]
ans.sort()
print(ans[2])
import numpy as np
import itertools

def pd(s):
    #print(s)
    pass


# input
H, W, M = map(int, input().split())
ms = [
    [int(i) for i in input().split()]
    for m in range(M)
]
pd(f"{H=} {W=} {M=}")
pd(f"{ms=}")

rows = [0]*(H+1)
cols = [0]*(W+1)
bombs = np.zeros((H+1,W+1))

def get_total(row, col):
    total = 0
    for m in ms:
        if (m[0] == row) or (m[1] == col):
            total += 1
            pd(f"o:{m[0]=} {m[1]=}")
        else:
            pd(f"x:{m[0]=} {m[1]=}")
    return total

for m in ms:
    pd(f"{m=}")
    rows[m[0]] += 1
    cols[m[1]] += 1
    bombs[m[0]][m[1]] += 1

rows = np.array(rows)
max_rows = np.where(rows == rows.max())[0].tolist()
pd(f"{max_rows=}")

cols = np.array(cols)
max_cols = np.where(cols == cols.max())[0].tolist()
pd(f"{max_cols=}")

max_total = 0
kabu_flg = False
p = itertools.product(max_rows, max_cols)
for v in p:
    h = v[0]
    w = v[1]
    pd(f"{h=} {w=} {bombs[h][w]=}")
    if bombs[h][w] > 0:
        if kabu_flg is False:
            max_total = get_total(h,w)
            kabu_flg = True
    else:
        max_total = get_total(h,w)
        break


print(max_total)

### FIXED CODE ###

import numpy as np
import itertools


def pd(s):
    #print(s)
    pass


# input
H, W, M = map(int, input().split())
ms = [
    [int(i) for i in input().split()]
    for m in range(M)
]
pd(f"{H=} {W=} {M=}")
pd(f"{ms=}")

rows = [0]*(H+1)
cols = [0]*(W+1)
bombs = {}
for m in ms:
    h = m[0]
    w = m[1]
    rows[h] += 1
    cols[w] += 1
    bombs[f"{h},{w}"] = True

rmax = max(rows)
cmax = max(cols)
rmax_hs = [i for i, v in enumerate(rows) if v == rmax]
cmax_wh = [i for i, v in enumerate(cols) if v == cmax]

for m in itertools.product(rmax_hs, cmax_wh):
    h = m[0]
    w = m[1]
    if f"{h},{w}" not in bombs:
        print(rmax + cmax)
        exit()
print(rmax + cmax - 1)
import math

a = int(input())
b = float(input())

print(math.floor(a*b))

### FIXED CODE ###

li = input().split()
a = int(li[0])
b = str(li[1])
b = int(b.replace('.',''))

print(a*b//100)
N = int(input())
arr = map(int, input().split(' '))
ans = []
for i, num in enumerate(arr)
	if num == 1:
    	ans.append(i+1)
print(' '.join(ans))


### FIXED CODE ###

def main():
    n = int(input())
    A = [0] + list(map(int, input().rstrip().split()))
    for i in range(n // 2, 0, -1):  # second half: no multiples
        A[i] = sum(A[i::i]) % 2
    ans = [i for i, j in enumerate(A) if j]
    print(len(ans))  # all cells: [1] -> len() (much faster than sum())
    print(*ans)


if __name__ == "__main__":
    main()
X,N = map(int, input().split())
if N==0:
    print(X)
else:
    p=list(map(int,input().split()))
    A=[i for i in range(100) if i not in p]

mini=101
minip=101
for i in range(N):
    if abs(p[i]-X) <=mini:
        mini= abs(p[i]-X)
        minip=p[i]
        

minimini=101
answer=101
for a in A:
    if abs(a-minip)<minimini:
        minimini=abs(a-minip)
        answer=a

print(answer)

### FIXED CODE ###

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

dp=[0]*(max(A)+1)

for a in A:
    for x in range(a,len(dp),a):
        dp[x]+=1

count=0
for a in A:
    if dp[a]==1:
        count+=1

print(count)
ab=input()
print(ab[0]*ab[1],ab[0]*2+ab[1]*2)

### FIXED CODE ###

inp=input().split()
ab=[int(inp[0]),int(inp[1])]
print(ab[0]*ab[1],ab[0]*2+ab[1]*2)
n = int(input())
s = ""
for m in input():
    s += chr((ord(m)+n-ord("A"))%26+ord("A"))
print(s)

### FIXED CODE ###

d = {"SUN":1,"MON":2,"TUE":3,"WED":4,"THU":5,"FRI":6,"SAT":7}
print(8-d[input()])