Harryxun/stf_run huggingface dataset:
N,Z,W=map(int,input().split())
a=list(map(int,input().split()))
print(abs(w-a[0])if n==1 else max(abs(w-a[-1]),abs(a[-1]-a[-2])))

### FIXED CODE ###

N,Z,W=map(int,input().split())
a=list(map(int,input().split()))
print(abs(W-a[0])if N==1 else max(abs(W-a[-1]),abs(a[-1]-a[-2])))
l=[c for c in input()]
l1=[-1]
l2=[]
for i,j in enumerate(l):
  if j not in 'ACGT':
    l1.append(i)
for i in range(len(l1)-1):
  l2.append(l1[i+1]-l1[i]-1)
print(max(l2))

### FIXED CODE ###

l=[c for c in input()]
l1=[-1]
l2=[]
for i,j in enumerate(l):
  if j not in 'ACGT':
    l1.append(i)
l1.append(len(l))
for i in range(len(l1)-1):
  l2.append(l1[i+1]-l1[i]-1)
print(max(l2))
N = int(input())
A = [int(i) for i in input().split()]
A = [A[_] - (_ + 1) for _ in range(N)]
AA = sorted(A)
ans = 0
ans1 = 0
if N % 2 != 0:
    center = N // 2
    num = AA[center]
    for i in range(N):
        ans += abs(AA[i]-num)
    print(ans)
else:
    center = len(AA) // 2
    for i in range(N):
        ans += abs(AA[i]- num)
        ans1 += abs(AA[i]-(num + 1))
    print(min(ans, ans1))

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
A = [A[_] - (_ + 1) for _ in range(N)]
AA = sorted(A)
ans = 0
ans1 = 0
center = N // 2
num = AA[center]

if N % 2 != 0:
    for i in range(N):
        ans += abs(AA[i] - num)
    print(ans)
else:
    center = len(AA) // 2
    for i in range(N):
        ans += abs(AA[i]- num)
        ans1 += abs(AA[i]-(AA[center-1]))
    print(min(ans, ans1))
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

tmp = -1
sum = 0
for i in range(n):
    sum += b[i]
    if a[i] == tmp + 1:
        sum += c[i]
    tmp = a[i]
print(sum)

### FIXED CODE ###

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

tmp = -1
sum = 0
for i in range(n):
    sum += b[i]
    if a[i] == tmp + 1:
        sum += c[tmp-1]
    tmp = a[i]
print(sum)
# -*- coding: utf-8 -*-
import math

N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))


def gcd_list(numbers):
    res = math.gcd(numbers[0], numbers[1])
    if len(numbers) > 2:
        for idx in range(2, len(numbers)):
            res = math.gcd(res, numbers[idx])
    return res


max_gcd = 0
if(N) == 2:
    max_gcd = max(As)
else:
    for i in range(N):
        others = [As[j] for j in range(N) if j != i]
        max_gcd = max(gcd_list(others), max_gcd)

print(max_gcd)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import fractions

N = int(input().rstrip())
A = [0] + list(map(int, input().rstrip().split())) + [0]

L = [0] * (N + 2)
R = [0] * (N + 2)

for i in range(0, N):
    L[i + 1] = fractions.gcd(L[i], A[i + 1])

for i in range(N, 0, -1):
    R[i] = fractions.gcd(R[i + 1], A[i])

print(max(fractions.gcd(L[i], R[i + 2]) for i in range(0, N)))
n,m = map(int,input().split())
c = [list(map(int,input().split())) for i in range(n)]
ca = sorted(c,key=lambda x:x[0])

import sys
if n ==1:
    print(ca[0][0]*ca[0][1])
    sys.exit()
money = 0
i = 0
num = 0
while True:
    #print(str(i)+"だよ")
    if num + ca[i][1] <= m:
        num += ca[i][1]
        money += ca[i][0] * ca[i][1]
        i += 1
        #print(num,money)
    else:
        money += ca[i][0]*(m-num)
        break    
print(money)

### FIXED CODE ###

n,m = map(int,input().split())
c = [list(map(int,input().split())) for i in range(n)]
ca = sorted(c,key=lambda x:x[0])

import sys
if n ==1:
    print(ca[0][0]*ca[0][1])
    sys.exit()
money = 0
i = 0
num = 0
while True:
    #print(str(i)+"だよ")
    if num + ca[i][1] < m:
        num += ca[i][1]
        money += ca[i][0] * ca[i][1]
        i += 1
        #print(num,money)
    else:
        money += ca[i][0]*(m-num)
        break    
print(money)
n,x=map(int,input().split())
a=list(map(int,input().split()))
b=[]
for i in a:b.append(abs(x-i))
while len(b)>1:b.append(fractions.gcd(b.pop(-1),b.pop(-1)))
print(b[0])

### FIXED CODE ###

import fractions
n,x=map(int,input().split())
a=list(map(int,input().split()))
b=[]
for i in a:b.append(abs(x-i))
while len(b)>1:b.append(fractions.gcd(b.pop(-1),b.pop(-1)))
print(b[0])
n, m = map(int, input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())

up = [0]*(m+1)
up[0] = a[0]-1
up[m] = n - a[m-1]-1
ans = 1
for i in range(m-1):
  up[i+1] = a[i+1]-a[i]-2

if -1 in up:
  ans = 0
else:
  f = [0]*(max(up)+1)
  f[0] = 1
  f[1] = 1
  for i in range(2, max(up)+1):
    f[i] = f[i-1] + f[i-2]
  for i in range(m+1):
    ans *= f[up[i]]

print(ans % 1000000007)

### FIXED CODE ###

n, m = map(int, input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())

up = [0]*(m+1)
if m == 0:
  up[0] = n
else:
  up[0] = a[0]-1
  up[m] = n - a[m-1]-1
  for i in range(m-1):
    up[i+1] = a[i+1]-a[i]-2

ans = 1
if -1 in up:
  ans = 0
else:
  f = [0]*(max(up)+1)
  f[0] = 1
  if max(up) > 0:
    f[1] = 1
    for i in range(2, max(up)+1):
      f[i] = f[i-1] + f[i-2]
  for i in range(m+1):
    ans *= f[up[i]]

print(ans % 1000000007)
n=int(input())
d=[int(input()) for i in range(n)]
print(len(set(d))

### FIXED CODE ###

n=int(input())
d=[int(input()) for _ in range(n)]

print(len(set(d)))
n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
i=0
j=0
count=0
ans=0
for i in range(1,n):
  A[i]=A[i]+A[i-1]


for j in range(1,m):
  B[i]=B[i]+B[i-1]

a_cnt=0
b_cnt=m
for a_cnt in range(n+1):
  if A[a_cnt]>k:
    continue
  #print('A',A[a_cnt])
  while A[a_cnt]+B[b_cnt]>k:
    #print('B',B[b_cnt+1])
    b_cnt-=1 
  ans=max(ans,a_cnt+b_cnt)
print(ans)

### FIXED CODE ###

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

ans=0
for i in range(1,n+1):
  A[i]+=A[i-1]


for j in range(1,m+1):
  B[j]+=B[j-1]


b_cnt=m
for a_cnt in range(n+1):
  if A[a_cnt]>k:
    continue
  while A[a_cnt]+B[b_cnt]>k:
    b_cnt-=1 

  ans=max(ans,a_cnt+b_cnt)
print(ans)
from bisect import bisect
from math import factorial
n = int(input())
R,B,G = [],[],[]
m,M,mid = [],[],[]
ans = factorial(n)
for i,j in enumerate(input()):
	if j=="R":
		R += [i]
	elif j=="B":
		B += [i]
	else:
		G += [i]
for r,b,g in zip(R,B,G):
	f,s,t = sorted([r,b,g])
	m += [f]
	M += [t]
	mid += [s]
for i,j in enumerate(mid):
	i = bisect(m,j) - i
	if i > 1:
		ans *= i
for i,j in enumerate(mid[::-1]):
	i = n - i - bisect(M,j)
	if i > 1:
		ans *= i
print(ans)

### FIXED CODE ###

s=input()
ans=0
t=c=""
for i in s:
	t+=i
	if c!=t:
		ans+=1
		c=t
		t=""
print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))

t = 0
now = 1
footprint = [1]

while t < K:
  if A[now-1] not in footprint:
    footprint.append(A[now-1])
    now = A[now-1]
    t += 1
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = (K-s) % l
    now = footprint[i+e]
    break

print(now)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
 
t = 0
now = 1
footprint = [1]
past = [0]*N
past[0] = 1

while t < K:
  if past[A[now-1]-1] == 0:
    now = A[now-1]
    footprint.append(now)
    past[now-1]=1
    t += 1
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = (K-s) % l
    now = footprint[s+e]
    break
    
print(now)
[N,K] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
	
dp = []

dp[0] = 0
for i in range(1,N):
	d[i] = min(d[j] + abs(h[i] - h[j]) for j in range(max(i-K,0),i))
	
print(dp[-1])

### FIXED CODE ###

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


def frog(n, k, h):
    d = [float('inf')] * n
    d[0] = 0

    for i in range(1, n):
        d[i] = min(
            d[j] + abs(h[i] - h[j]) for j in range(max(i - k, 0), i)
        )
    return d[n - 1]


print(frog(n, k, h))
import sqrt from numpy

a = int(input())
b = int(input())
c = int(input())

result = (sqrt(a) + sqrt(b)) < sqrt(c)
if result:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys

argument = sys.stdin.readline()
args = argument.split()
a = int(args[0])
b = int(args[1])
c = int(args[2])

d = c - a - b

result = (d > 0) and 4 * a * b < d**2
if result:
    print("Yes")
else:
    print("No")
h=input()
w=input()
n=input()

if h < w:
    a =w
else:
    a=h

ans=n/a
if n%a > 0:
    ans+=1

print(ans)

### FIXED CODE ###

h = int(input())
w = int(input())
n = int(input())

a = 0
ans = 0

if h < w:
    a = w
else:
    a = h

ans = n // a
# int(ans)
if n % a > 0:
    ans += 1

print(ans)
v = int(input())

if v < 1200:
  print('ABC')
else if v < 2800:
  print('ARC')
else:
  print('AGC')

### FIXED CODE ###

v = int(input())
 
if v < 1200:
  print('ABC')
elif v < 2800:
  print('ARC')
else:
  print('AGC')
pi = 3.141592653589

r = float(input())

print(r*r*pi,2*pi*r


### FIXED CODE ###


pi = 3.141592653589

r = float(input())

print(r*r*pi,2*pi*r)
n= int(input())
a=list(map(int,input().split()))
i=0
j=0
p=0
while(i<len(a)):
  j=i+1
  s=0
  while(j<len(a)):
    s=s+a[j]
   	j=j+1
  p=p+s*a[i]
  i=i+1
print(p)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
i=0
j=0
p=0
while(i<len(a)):
  j=i+1
  s=0
  while(j<len(a)):
      s=s+a[j]
      j=j+1
  
  p=p+s*a[i]
  i=i+1
print(p)
from sys import stdin
import itertools
import numpy as np
from numba import njit

def main():
#入力
    readline=stdin.readline
    N,M,Q=map(int,readline().split())
    a=np.zeros(Q,dtype=np.int64)
    b=np.zeros(Q,dtype=np.int64)
    c=np.zeros(Q,dtype=np.int64)
    d=np.zeros(Q,dtype=np.int64)
    for i in range(Q):
        a[i],b[i],c[i],d[i]=map(int,readline().split())

    arrays=np.array(list(itertools.combinations_with_replacement(range(1,M+1),N)),dtype=np.int64)
    l=len(arrays)

    print(f(l,Q,a,b,c,d,arrays))
    
@njit("i8(i8,i8,i8[:],i8[:],i8[:],i8[:],i8[:,:])",cache=True)
def f(l,Q,a,b,c,d,arrays):
    max_res=0
    for i in range(l):
        res=0
        for j in range(Q):
            if arrays[i][b[j]-1]-arrays[i][a[j]-1]==c[j]:
                res+=d[j]
        max_res=max(max_res,res)
    return max_res

if __name__=="__main__":
	main()

### FIXED CODE ###

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    K=int(readline())
    A,B=map(int,readline().split())
    if A%K==0:
        print("OK")
    elif A//K<B//K:
        print("OK")
    else:
        print("NG")
if __name__=="__main__":
    main()
def partition(p, r):
    x = A[r]
    i = p - 1
    for j in range(p, r):
        if A[j] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i + 1], A[r] = A[r], A[i + 1]
    return i + 1
n = int(input())
A = [int(i) for i in input().split()]
q = partition(0, n - 1);
print(*A[:q], "[" + str(A[q]) + "]", end="")
if len(A[q + 1:]) > 0:
    print("", *A[q + 1:])
else:
    print("")

### FIXED CODE ###

def partition(A, p, r):
    x = A[r]
    i = p - 1
    for j in range(p, r):
        if A[j] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i + 1], A[r] = A[r], A[i + 1]
    return i + 1
n = int(input())
A = list(map(int, input().split()))
p = partition(A, 0, n - 1)
A[p] = f"[{A[p]}]"
print(*A)
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

L = I()

r = math.floor(math.log2(L+1))
M = 0
edge = []
for i in range(r):
    edge.append([i,i+1,0])
    edge.append([i,i+1,2**i])
    M += 2
for i in range(r)[::-1]:
    if L-2**i >= 2**r:
        edge.append([i,r,L-2**i])
        M += 1
        L -= 2**i

print(r+1,M)
for e in edge:
    print(e[0]+1, e[1]+1, e[2])

### FIXED CODE ###

import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

L = I()

N = math.floor(math.log2(L))+1
M = 0
edge = []
for i in range(N-1):
    edge.append([i,i+1,0])
    edge.append([i,i+1,2**i])
    M += 2
for i in range(N-1)[::-1]:
    if L-2**i >= 2**(N-1):
        edge.append([i,N-1,L-2**i])
        M += 1
        L -= 2**i

print(N,M)
for e in edge:
    print(e[0]+1, e[1]+1, e[2])
def solve():
    _ = int(input())
    a = list(map(int, input().split()))
    
    counter = [0] * 9
    for ai in a:
        counter[ai // 400] += 1
    
    ans_min = 0
    for i in range(8):
        if 0 < counter[i]:
            ans_min += 1
    
    ans_max = min(8, ans_min + counter[-1])
    print(ans_min, ans_max)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

def solve():
    _ = int(input())
    a = list(map(int, input().split()))
    
    counter = [0] * 9
    for ai in a:
        counter[min(8, ai // 400)] += 1
    
    ans_min = 0
    for i in range(8):
        if 0 < counter[i]:
            ans_min += 1
    
    ans_max = ans_min + counter[-1]
    if ans_min == 0:
        ans_min = 1
    print(ans_min, ans_max)


if __name__ == '__main__':
    solve()
a = input().split()
if a[0]* a[1] % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a = input().split()
if int(a[0])* int(a[1]) % 2 == 0:
  print("Even")
else:
  print("Odd")
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

abc = [tuple(map(int,input().split())) for i in range(m)]
es = [[] for i in range(n)]
for i,(a,b,c) in enumerate(abc):
    a,b = a-1,b-1
    es[i]=[a,b,c]

INF = float('inf')

#True : 負の経路が存在する
def find_negative_loop(n,w,es):
    #負の経路の検出
    #n:頂点数, w:辺の数, es[i]: [辺の始点,辺の終点,辺のコスト]
    d = [-INF] * n
    d[0] = 0
    #この始点はどこでもよい
    for i in range(n):
        for j in range(w):
            e = es[j]
            if d[e[1]] < d[e[0]] + e[2]:
                d[e[1]] = d[e[0]] + e[2]
                if i == n-1:
                    return INF
    return d[n-1]

ans = find_negative_loop(n,m,es)

if ans == INF:
    print('inf')
    exit()

print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n, m = map(int, input().split())
abc = [tuple(map(int,input().split())) for i in range(m)]
es = []
for a,b,c in abc:
    a,b = a-1,b-1
    es.append((a,b,c))

INF = float('inf')

def find_negative_loop(n,es,s):
    #負の経路の検出
    #n:頂点数, es[i]: [辺の始点,辺の終点,辺のコスト], s:始点
    dist = [-INF] * n
    dist[s] = 0

    for i in range(n):
        for a,b,c in es:
            if dist[b] < dist[a]+c:
                dist[b] = dist[a]+c
                # if i == n-1: # n回目にも更新が行われている場合，ループが存在する
                if i == n-1 and b==n-1: # 終点に影響を及ぼすループが存在する
                        return INF
    return dist[n-1]

ans = find_negative_loop(n,es,0)

if ans == INF:
    print('inf')
    exit()

print(ans)
li = []
n = int(input())
for i in range(5):
    li.append(int(input()))
print(5 + n // min(li))

### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, q = na()
s = input()
ct = [0] * n
for i in range(n-1):
    if s[i:i+2] == 'AC':
        ct[i+1] = 1
for i in range(n-1):
    ct[i+1] += ct[i]
for i in range(q):
    l, r = na()
    l -= 1
    r -= 1
    print(ct[r] - ct[l])
import math
R = input()
return 2*math.pi

### FIXED CODE ###

import math
R = int(input())
a = 2*math.pi*R
print(a)
N,K = map(int,input().split())
L = list(map(int,input().split()))
Lplus = list(filter(lambda x: x>=0, L))
Lminus = list(filter(lambda x: x<0 ,L))[::-1]
ans_table = []
#print(L)
#right_only
if len(Lplus) >= K:
    ans_table.append(Lplus[K-1])
#left_only
if len(Lminus) >= K:
    ans_table.append(Lminus[K-1])
#once_turn_right_to_left
for i in range(len(Lplus)-1):
    if i > K: break
    remain = K - i
    tmp = abs(Lplus[i-1])
    if remain <= len(Lminus):
        tmp += abs(Lplus[i-1] - Lminus[K-i-1])
        ans_table.append(tmp)
#once_turn_left_to_right
Lplus,Lminus = Lminus,Lplus
for i in range(len(Lplus)-1):
    if i > K: break
    remain = K - i
    tmp = abs(Lplus[i-1])
    if K - i <= len(Lminus):
 #       print(Lminus[K-i-1],Lplus[i-1],i)
        tmp += abs(Lplus[i-1] - Lminus[K-i-1])
        ans_table.append(tmp)

#print(ans_table)
print(min(ans_table))



### FIXED CODE ###

N, K  = map(int,input().split())
L =list(map(int,input().split()))
Lzero = list(filter(lambda x:x==0,L))
Lright = list(filter(lambda x:x>0,L))
Lleft = list(map(lambda x:abs(x),filter(lambda x:x<0,L)))[::-1]
K -= len(Lzero)
if K <= 0:
    print(0)
    quit()

dis = []
if len(Lright) == 0:
    print(Lleft[K-1])
    quit()
if len(Lleft) == 0:
    print(Lright[K-1])
    quit()
try :
    dis.append(Lright[K-1])
    dis.append(Lleft[K-1])
except:
    pass


for i in range(len(Lright)):
    remain = K
    if i+1 >K:
        break
    elif i+1 == K:
        dis.append(Lright[i])
        break
    d = 2*Lright[i]
    remain -= (i+1)
    try :
        d += Lleft[remain-1]
        dis.append(d)
    except:
        pass
for i in range(len(Lleft)):
    remain = K
    if i+1 >K:
        break
    elif i+1 == K:
        dis.append(Lleft[i])
        break
    d = 2*Lleft[i]
    remain -= (i+1)
    try:
        d += Lright[remain-1]
        dis.append(d)
    except:
        pass
print(min(dis))
N=int(input())

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10**(N-2)
	each=N*(N-1)/2
	final=without*each

	considered=final%(1000000007)

	print(final)

### FIXED CODE ###

MOD=10**9+7
N=int(input())
 
all=pow(10,N,MOD)
sub9=pow(9,N,MOD)
sub8=pow(8,N,MOD)
print((all-2*sub9+sub8)%MOD)
import sys

def sum_dig(num):
    sum = 0
    while(num):
        dig = num % 10
        sum = sum + dig
        num = num // 10
#        print (dig,sum,num)
    return sum


lim, min, max = map(int, input().split(" "))
chk_sum = 0
for i in range(1,lim+1) :
    chk = sum_dig(i)
#    print(chk,type(chk))
    if (chk >= min and chk <= max) :
        chk_sum += i

print (chk_sum)


### FIXED CODE ###


a,b,c,d = map(int, input().split(" "))

if a+b < c+d :
    print("Right\n")
elif a+b > c+d:
    print("Left\n")
else :
    print("Balanced\n")
import numpy as np
x,y = [int(i) for i in input().split()]

ans_array = np.array([],dtype = np.int64)

if y - x >= 0:
    ans_array = np.append(ans_array,y-x)
if y - abs(x) >= 0:
    ans_array = np.append(ans_array,y-abs(x)+1)
if abs(y) - x >= 0:
    ans_array = np.append(ans_array,abs(y)-x+1)
if abs(y) -abs(x) >= 0:
    ans_array = np.append(ans_array,abs(y)-abs(x) + 2)

print(ans_array.min())

### FIXED CODE ###

x,y = [int(i) for i in input().split()]
 
if x < y:
    if x*y < 0:
        print(1 + abs(abs(x) - y))
    else:
        print(y - x)
else:
    if x*y <= 0:
        print(1 + abs(x - abs(y)))
    else:
        print(2 + abs(x - y))
n = int(input())
a = list(map(int,input().split()))
if n == 1:
    print(1)
    exit()
flag = [True for i in range(10**6+1)]
a.sort()
for i in range(n):
    if flag[a[i]] == False:
        continue
    if i >= 1:
        if a[i] == a[i-1]:
            continue
    for j in range(2,(10**6)//a[i]+1):
        flag[a[i]*j] = False
ans = 0
for i in range(n):
    if flag[a[i]]:
        if i >= 1:
            if a[i] == a[i-1]:
                continue
        if i <= n-1:
            if a[i] == a[i+1]:
                continue
        ans+=1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
if n == 1:
    print(1)
    exit()
flag = [True for i in range(10**6+1)]
a.sort()
for i in range(n):
    if flag[a[i]] == False:
        continue
    if i >= 1:
        if a[i] == a[i-1]:
            continue
    for j in range(2,(10**6)//a[i]+1):
        flag[a[i]*j] = False
ans = 0
for i in range(n):
    if flag[a[i]]:
        if i >= 1:
            if a[i] == a[i-1]:
                continue
        if i < n-1:
            if a[i] == a[i+1]:
                continue
        ans+=1
print(ans)
def LCS():
    seq1 = raw_input()
    seq2 = raw_input()
 
    a, b = len(seq1), len(seq2)
    for i in range(b + 1):
      x1[i] = 0 
    for i in range(a):
        e1 = seq1[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == seq2[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i in range(n):
    print LCS()

### FIXED CODE ###

def LCS():
    X = raw_input()
    Y = raw_input()
 
    a, b = len(X), len(Y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = X[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == Y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i in range(n):
    print LCS()
N = input()
steps = [i for i in N]
N = len(N)
ans = "Yes"
#024 L があるとダメ
for i in range(0,N+1,2):
    if steps[i] == "L":
        ans = "No"
for i in range(1,N,2):
    if steps[i] == "R":
        ans = "No"
print(ans)


### FIXED CODE ###


N = input()
steps = [i for i in N]
N = len(N)
ans = "Yes"
for i in range(0,N,2):
    if steps[i] == "L":
        ans = "No"
for i in range(1,N,2):
    if steps[i] == "R":
        ans = "No"
print(ans)
n,k=map(int,input().split())
lists=list(map(int,input().split()))
Chlist=[0]*n
countlist=[0]*40
for s in range(n):
    Chlist[s]=format(lists[s],"0%ib"%40)
    for i in range(40):
        if Chlist[s][i]=="1":
            countlist[39-i]+=1

#countlistのi桁めが2**(i-1)の数である
power=0
for i in range(40):
    if 2**i<=k<2**(i+1):
        power=i
ans1=0
for j in range(power):
    ans1+=(2**j)*max(countlist[j],n-countlist[j])
ans1+=(2**power)*(countlist[power])


uselist=[0]*(k-2**power+1)
for some in range(k-2**power+1):
    c=format(some,“0%ib"%40)
    uselist[some]=c


ans2=0

ans2+=(2**power)*(n-countlist[power])

biggest=0
big=0
for i in uselist:
    for j in range(40):
        if  i[39-j]=="1" and j!=power:
            big+=(2**j)*(n-countlist[j])
        elif i[39-j]=="0"and j!=power:
            big+=(2**j)*countlist[j]
    biggest=max(biggest,big)
    big=0


ans2+=biggest
print(max(ans1,ans2))

### FIXED CODE ###

n,k=map(int,input().split())
k2=format(k+1,"0%ib"%40)
lists=list(map(int,input().split()))
countlist=[0]*40
for j in lists:
    c=format(j,"0%ib"%40)
    for i in range(40):
        if c[i]=="1":
            countlist[i]+=1

emptylist=[]
for i in range(40):
    if k2[i]=="1":
        emptylist.append(i)
if k>=1:
    ans=0
    for i in emptylist:
        subing=0
        for j in range(40):
            if j<i:
                if k2[j]=="1":
                    subing+=(2**(39-j))*(n-countlist[j])
                elif k2[j]=="0":
                    subing+=(2**(39-j))*countlist[j]
            if j==i:
                subing+=(2**(39-i))*countlist[i]
            
            if j>i:
                subing+=(2**(39-j))*max(countlist[j],n-countlist[j])
        ans=max(ans,subing)
    print(ans)
elif k==0:
    ans=0
    for i in range(40):
        ans+=(2**(39-i))*countlist[i]
    print(ans)