Harryxun/stf_run huggingface dataset:
import fractions as math

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

#同じく最小公倍数
def lcmlist(l):
    a = l[0]
    for i in range(len(l)):
        a = int(a)
        a = a*l[i]/math.gcd(a,l[i])
    return int(a)

lcm = lcmlist(list1)
lcm -= 1
ans = 0
for i in list1:
    ans += lcm%i

print(ans)


### FIXED CODE ###

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

ans = 0
for i in list1:
    ans += i-1
print(ans)
n = int(input())

p = map(int, input().split())

count = 0
for i in range(n):
  if (p[i+1]>p[i] and p[i]>=p[i-1]) or (p[i-1]>p[i] and p[i]>=p[i+1]):
    count += 1
    
print (count)

### FIXED CODE ###

n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)
n=int(input())
elif n<105:
  print(0)
elif n<135:
  print(1)
elif n<165:
  print(2)
else:
  print(3)


### FIXED CODE ###

n=int(input())
if n<105:
  print(0)
elif n<135:
  print(1)
elif n<165:
  print(2)
elif n<189:
  print(3)
elif n<195:
  print(4)
else:
  print(5)
from sys import stdin

S = input()
Q = int(input())

T_list = []
for q in range(Q):
    T = stdin.readline()
    T_list.append(T)

for t in T_list:
    if t == '1':
        S = S[::-1]

    else:
        T, f, c = t.split()

        if f == '1':
            S = c + S
        else:
            S = S + c

print(S) 


### FIXED CODE ###

from sys import stdin

S = input()
Q = int(input())

reverse_flg = False

former_list = []
latter_list = []

for q in range(Q):
    T = stdin.readline()[:-1]

    if T == '1':
        if reverse_flg:
            reverse_flg = False
        else:
            reverse_flg = True
    
    else:
        t, f, c = T.split()
        if (f == '1' and reverse_flg == False) or (f == '2' and reverse_flg == True):
            former_list.append(c)
        else:
            latter_list.append(c)


if reverse_flg:
    latter_list = ''.join(reversed(latter_list))
    former_list = ''.join(former_list)
    S = ''.join(list(reversed(S)))
    S = ''.join([latter_list, S, former_list])

else:
    former_list = ''.join(reversed(former_list))
    latter_list = ''.join(latter_list)
    S = ''.join([former_list, S, latter_list])

print(S)
x**3

### FIXED CODE ###

x=eval(input())
print(x**3)
A,B,C=map(int,input().split())

hoge=set([A,B,C])
if hoge==set([5,7]):
    if A+B+C=17:
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

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

hoge=set([A,B,C])
if hoge==set([5,7]):
    if A+B+C==17:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
a,b=[int(i) for i in input().split()]
from math import *
#def lcm(x,y):
    #return (x*y) // math.gcd(x,y)

  
  
z= (a * b)/math.gcd(a, b)
print(int(z))

### FIXED CODE ###

A, B=[int(i) for i in input().split()]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)
  
print(lcm(A,B))
ss = str(input())
a = ss.count("R")

if a == 2 and a[2] == 0:
  a = 1

print(a)  


### FIXED CODE ###

ss = str(input())
a = int(ss.count("R"))

if ss == "RSR":
  a = 1

print(a)
c = input()

l = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','y','u','v','w','y','z']
num = int(l.index(c))+1
print(l[num])

### FIXED CODE ###

c = input()

l = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','y','z']
num = int(l.index(c))+1
print(l[num])
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
 
N = int(input())
l = list(map(int, input().split(" ")))
 
p = gcd(l)
 
n = reduce(lambda a, b: a * b, l) / (p ** N) / (10 ** 9 + 7)
print(n)

### FIXED CODE ###

import fractions
from functools import reduce
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
l = list(map(int, input().split(" ")))
 
p = lcm_list(l)
c = 0
for i in l:
  c += p // i
print(c % (10 ** 9 + 7))
x = input()
def f(x):
  if x == ABC:
    print("ARC")
  elif x == ARC:
    print("ABC")
  else:
    print("invalid input")

print(f(x))

### FIXED CODE ###

x = input()
def f(x):
    if x == "ABC":
        print("ARC")
    elif x == "ARC":
        print("ABC")
    else:
        print("invalid input")
f(x)
print(x**3)


### FIXED CODE ###

number = int(input())
print(number**3)
A,B,C,K = map(int,input().split())
Ans = 0
if K%2==1:
    Ans = (B-A
else:
    Ans = A-B
print(Ans if Ans <= 10**18 else "Unfair")

### FIXED CODE ###

A,B,C,K = map(int,input().split())
Ans = 0
if K%2==1:
    Ans = B-A
else:
    Ans = A-B
print(Ans if Ans <= 10**18 else "Unfair")
= int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')


### FIXED CODE ###

n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
if a_post < z_pos:
  out = new[a_pos:(z_pos+1)]
    
new_string = ""
for j in out:
  new_string += j
print(len(new_string))


### FIXED CODE ###

sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)
s = input().split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
pattterns = [[1, 2, 3],
             [1, 5, 9],
             [1, 4, 7],
             [2, 5, 8],
             [3, 5, 7],
             [3, 6, 9],
             [4, 5, 6],
             [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

### FIXED CODE ###

import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
        sys.exit()
print("No")
day, assignment = map(int, input().split())
assignment_time = map(int, input().split())
if sum(assignment_time) > N:
    print(-1)
else:
    print(N - sum(assignment_time))

### FIXED CODE ###

N, M = map(int, input().split())
A = map(int, input().split())
print(max(N - sum(A), -1))
hoge = list(map(int, input().split()))
huga = hoge.sort()
if huga == [5,5,7]:
  print("YES")
elif:
  print("NO")

### FIXED CODE ###

hoge = list(map(int, input().split()))
huga = sorted(hoge)
if huga == [5,5,7]:
  print("YES")
else:
  print("NO")
a, b =  = input().split()

if a > b:
  print(">")
elif a == b:
  print("=")
else:
  print("<")

### FIXED CODE ###

a, b = input().split()

if a > b:
  print(">")
elif a == b:
  print("=")
else:
  print("<")
N,Y=map(int,input().split())

for i in range(N+1):
    for j in range(N+1-j):
        if i*10000+j*5000+(N-i-j)*1000==Y:
            print(i,j,N-i-j)
            exit()
print(-1,-1,-1)


### FIXED CODE ###


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

for i in range(N+1):
    for j in range(N+1-i):
        if i*10000+j*5000+(N-i-j)*1000==Y:
            print(i,j,N-i-j)
            exit()
print(-1,-1,-1)
n=input()
s=input()
a=0
for i in range(0,n):
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
        a=a+1
print(a)

### FIXED CODE ###

n=int(input())
s=input()
a=0
if n>2:
    for i in range(0,n):
        if i<n-2 and s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
         a=a+1
print(a)
x,a,b=map(int,input().split())
if abs(x-a)>=abs(x-b)
  print('B')
else:
  print('A')


### FIXED CODE ###

x,a,b=map(int,input().split())
if abs(x-a)>=abs(x-b):
  print('B')
else:
  print('A')
import copy

s = input()
X, Y = list(map(int, input().split()))

#少なくとも、右にx,↑にy進まなきゃいけない
# Fはくっつけられる
# s < 8000 よって N^2くらいならok
# Tが1回→左右 2回→前か後ろ 3回→左右
# この性質から、左右は左右のみで考えればいい
# x方向の数字N個をつかって、xを作成する 足し引きのみ 2^N xを加えて0にできるかどうか

s += "T"

now = 1
# 1はx方向、-1はy方向とする
start = 0
go = 0
x = []
y = []
for i in s:
    if i == "T":
        if start == 0:
            X = X - go
            go = 0
            start = 1
        else:
            if go != 0:
                if now == 1:
                    x.append(go)
                else:
                    y.append(go)
                go = 0
        now *= -1
    if i == "F":
        go += 1

X = abs(X)
Y = abs(Y)
x_use = sum(x) - X
y_use = sum(y) - Y
if x_use % 2 == 1 or y_use % 2 == 1 or x_use < 0 or y_use < 0:
    print("No")
    exit()
x_use = x_use//2
y_use = y_use//2


def solve(integer_list, target_sum,  i=0, sum=0):
    if sum > target_sum:
        False
    if i == len(integer_list):
        return sum == target_sum
    if (solve(integer_list, target_sum, i + 1, sum)):
        return True
    if (solve(integer_list, target_sum, i + 1, sum + integer_list[i])):
        return True
    return False

if solve(x, x_use) and solve(y, y_use):
    print("Yes")
else:
    print("No")




### FIXED CODE ###

import copy

s = input()
X, Y = list(map(int, input().split()))

#少なくとも、右にx,↑にy進まなきゃいけない
# Fはくっつけられる
# s < 8000 よって N^2くらいならok
# Tが1回→左右 2回→前か後ろ 3回→左右
# この性質から、左右は左右のみで考えればいい
# x方向の数字N個をつかって、xを作成する 足し引きのみ 2^N xを加えて0にできるかどうか

s += "T"

now = 1
# 1はx方向、-1はy方向とする
start = 0
go = 0
x = []
y = []
for i in s:
    if i == "T":
        if start == 0:
            X = X - go
            go = 0
            start = 1
        else:
            if go != 0:
                if now == 1:
                    x.append(go)
                else:
                    y.append(go)
                go = 0
        now *= -1
    if i == "F":
        go += 1
x.sort()
y.sort()
x = x[::-1]
y = y[::-1]
X = abs(X)
Y = abs(Y)
x_use = sum(x) - X
y_use = sum(y) - Y
if x_use % 2 == 1 or y_use % 2 == 1 or x_use < 0 or y_use < 0:
    print("No")
    exit()
x_use = x_use//2
y_use = y_use//2


def solve(integer_list, target_sum,  i=0, sum=0):
    if sum > target_sum:
        return False
    if sum == target_sum:
        return True
    if i == len(integer_list):
        return sum == target_sum
    if (solve(integer_list, target_sum, i + 1, sum)):
        return True
    if (solve(integer_list, target_sum, i + 1, sum + integer_list[i])):
        return True
    return False

#if solve(x, x_use) and solve(y, y_use):
#    print("Yes")
#else:
#    print("No")


def part_sum0(a,A):
    #初期化
    N=len(a)
    dp=[[0 for i in range(A+1)] for j in range(N+1)]
    dp[0][0]=1

    #DP
    for i in range(N):
        for j in range(A+1):
            if a[i]<=j: #i+1番目の数字a[i]を足せるかも
                dp[i+1][j]=dp[i][j-a[i]] or dp[i][j]
            else: #入る可能性はない
                dp[i+1][j]=dp[i][j]
    return dp[N][A]
 
if part_sum0(x,x_use) and part_sum0(y, y_use):
    print("Yes")
else:
    print("No")
import sys
S=list(input())
c=len(R)
for i in range(c):
  if i%2==0:
    if L[i]!="R" and L[i]!="D" and L[i]!="U":
      print("No")
      sys.exit()
  else:
    if L[i]!="L" and L[i]!="D" and L[i]!="U":
      print("No")
      sys.exit()
print("Yes")

### FIXED CODE ###

import sys
L=list(input())
c=len(L)
for i in range(c):
  if i%2==0:
    if L[i]!="R" and L[i]!="D" and L[i]!="U":
      print("No")
      sys.exit()
  else:
    if L[i]!="L" and L[i]!="D" and L[i]!="U":
      print("No")
      sys.exit()
print("Yes")
w, h, x, y=map(int, input().split())
centX=w/2
centY=h/2
if x==centX and y==centY
    print(w*h/2, " ", "1")
else: print(w*h/2, " ", "0")

### FIXED CODE ###

w, h, x, y=map(int, input().split())
centX=w/2
centY=h/2
if x==centX and y==centY:
    print(w*h/2, " ", "1")
else: print(w*h/2, " ", "0")
n = input().split()

ar = int(n[0])
br = int(n[1])

a = []
b = []
for i in range(0, ar):
    a.append(input())

for j in range(0, br):
    b.append(input())

find = False
for i in range(0, ar - br):
    idx = a[i].find(b[0])
    if idx != -1:
        match = True
        for j in range(1, br):
            idx2 = a[i + j].find(b[j])
            if idx != idx2:
                match = False
        if match:
            find = True
            break
if find:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

c = input().split()
a = int(c[0])
b = int(c[1])
if a == 1:
    a = 14
if b == 1:
    b = 14

if a > b:
    print("Alice")
elif b > a:
    print("Bob")
else:
    print("Draw")
import collections
n = int(input())
ls = list(map(int,input().split()))
c =collections.Counter(ls)
d = list(c)
p = []
for i in range(len(d)):
    if c[d[i]] >1:
        p.append(d[i])
mx1 = max(p)
p.remove(mx1)
mx2 = max(p)
print(mx1 * mx2)
    

### FIXED CODE ###

import collections
import sys
n = int(input())
ls = list(map(int,input().split()))
c =collections.Counter(ls)
d = list(c)
p = []
q = []
mm = 0
mx3 = 0
for i in range(len(d)):
    if c[d[i]] >=4:
        p.append(d[i])
    if c[d[i]] >=2:
        q.append(d[i])
if p == [] and len(q) < 2:
    print(0)
    sys.exit()
if len(q) >= 2:
    mx1 = max(q)
    q.remove(mx1)
    mx2 = max(q)
    mm = mx1 * mx2
if p != []:
    mx3 = max(p)**2
print(max(mm,mx3))
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]

A.sort()
BC.sort(reverse=True,key = lambda x:x[1])

pt,card,index = 0,BC[0][1],0
while A[pt] < card:
    for i in range(BC[index][0]):
        if A[pt] < card:
            A[pt] = card
        pt += 1
        if pt >= N:
            break
    index += 1
    if index < M:
        card = BC[index][1]
    else:
        break

print(sum(A))


### FIXED CODE ###

#要修正　方針は合っているようだが・・・
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]

A.sort()
BC.sort(reverse=True,key = lambda x:x[1])

pt,card,index = 0,BC[0][1],0
while True:
    for i in range(BC[index][0]):
        if pt < N:
            A[pt] = max(A[pt],card)
        else:
            break
        pt += 1

    index += 1
    if index < M:
        card = BC[index][1]
    else:
        break

print(sum(A))
n,q = map(int,input().split())
S = input()
for i in range(q):
  l,r = map(int,input().split())
  A = S[l,r+1]
  cnt = A.count('AC')
  print(cnt)
  

### FIXED CODE ###

import numpy as np
N,Q = map(int,input().split())
S = np.array(list('_' + input()), dtype='U2')
A = (S == 'A')
C = (S == 'C')
AC = (A[:-1] & C[1:])
AC_cum = AC.cumsum()

for _ in range(Q):
  L,R = map(int,input().split())
  print(AC_cum[R-1] - AC_cum[L-1])
l=list(map(int,input().split.()))
n=l[0]
w=l[1]
wa=[0]*n
va=[0]*n
for i in range(n):
  g=input()
  wa[i]=int(g[0])
  va[i]=int(g[2])
dp=[[0 for j in range(w+1)] for i in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if wa[i-1]<j:
      dp[i][j]=dp[i-1][j]
    else:
      dp[i][j]=max(dp[i-1][j],dp[i-1][j-wa[i-1]]+va[i-1])
print(dp[-1][-1])



### FIXED CODE ###

def knapSack(W, wt, val, n): 
	K = [[0 for x in range(W+1)] for x in range(n+1)] 

	
	for i in range(n+1): 
		for w in range(W+1): 
			if i==0 or w==0: 
				K[i][w] = 0
			elif wt[i-1] <= w: 
				K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]], K[i-1][w]) 
			else: 
				K[i][w] = K[i-1][w] 

	return K[n][W] 




q=list(map(int,input().split()))
n=q[0]
W=q[1]
v=[0]*n
w=[0]*n
for _ in range(n):
  r=list(map(int,input().split()))
  w[_]=r[0]
  v[_]=r[1]
  




print(knapSack(W,w,v,n))
N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)
N=input()
N=int(input())

### FIXED CODE ###

N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)
a,b = map(int,input().split())
if b % a == 0
    print(a + b)
else:
    print(b - a)


### FIXED CODE ###

a, b = map(int,input().split())
if b % a == 0:
    print(a + b)
else:
    print(b - a)
n = int(input())
h = list(map(int,input().split()))
c = 0
d = 0

for j in range(n-1):
  for i in range(n-1):
    if h[j+i] >= h[j+i+1]:
      c += 1
    else:
      d = max(d,c)
      c = 0
      break
      
print(d)

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
c = 0
d = 0

for j in range(n-1):
  if h[j] >= h[j+1]:
    c += 1
  else:
    d = max(c,d)
    c = 0

d = max(c,d)
print(d)
n = int(input())

def dfs(s, mx):
    if len(s) == n:
        print(s)
    else:
        for c in [chr(ord('a') + i) for i in range(ord(mx) - ord('a') + 1)]:
            dfs(s + c, chr(ord(mx) + 1) if c == mx else mx)

dfx('', 'a')

### FIXED CODE ###

n = int(input())

def dfs(s, mx):
    if len(s) == n:
        print(s)
    else:
        for c in [chr(ord('a') + i) for i in range(ord(mx) - ord('a') + 1)]:
            dfs(s + c, chr(ord(mx) + 1) if c == mx else mx)

dfs('', 'a')
def main():
    n = int(input())
    if n <= 0:
        return None
    li = [int(input()) for _ in range(n)]
    li = sorted(li)
    for x in li:
        tmp = x.split(" ")
        tmp = sorted(tmp)
        a,b,c = tmp[0],tmp[1],tmp[2]
        if (a**2 + b**2) == c**2:
            print("YES")
        else:
            print("NO")
    return None

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    while True:
        try:
            num_list = [int(i) for i in input().split()]
            num_list = sorted(num_list)
            a,b,c = num_list[0],num_list[1],num_list[2]
            if (a**2 + b**2) == c**2:
                print("YES")
            else:
                print("NO")
        except EOFError:
            break
    return None

if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    n,m=list(map(int,input().split()))
    a=[0 for _ in range(n)]
    b=[0 for _ in range(n)]
    c=[0 for _ in range(n)]
    d=[[INF for i in range(n)] for i in range(n)]
    for i in range(m):
        a[i],b[i],c[i]=list(map(int,input().split()))
        a[i]-=1
        b[i]-=1
        d[a[i]][b[i]]=c[i]
        d[b[i]][a[i]]=c[i]
    
    for i in range(n):
        d[i][i]=0
    
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j]=min(d[i][j],d[i][k]+d[k][j])
                d[j][i]=d[i][j]
    ans=0
    for j in range(m):
        temp=1
        for i in range(n):
            if d[i][b[j]]==d[i][a[j]]+c[j]:
                temp=0
                break
        ans+=temp
    print(ans)
    
    
    
        
        
    
if __name__=="__main__":
    main()
    

### FIXED CODE ###

# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    n,m=list(map(int,input().split()))
    a=[0 for _ in range(m)]
    b=[0 for _ in range(m)]
    c=[0 for _ in range(m)]
    d=[[INF for i in range(n)] for i in range(n)]
    for i in range(m):
        a[i],b[i],c[i]=list(map(int,input().split()))
        a[i]-=1
        b[i]-=1
        d[a[i]][b[i]]=c[i]
        d[b[i]][a[i]]=c[i]
    
    for i in range(n):
        d[i][i]=0
    
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j]=min(d[i][j],d[i][k]+d[k][j])
                d[j][i]=d[i][j]
    ans=0
    for j in range(m):
        temp=1
        for i in range(n):
            if d[i][b[j]]==d[i][a[j]]+c[j]:
                temp=0
                break
        ans+=temp
    print(ans)
    
    
    
        
        
    
if __name__=="__main__":
    main()
C,D = [int(e) for e in input().split()]

if C <= D:
    m = D
    n = C
else:
    m = C
    n = D

while  n != 0 :
    a = m%n
    m = n
    n = a

J = []

for i in range(1,int(m**0.5)+1):
    if m % i == 0:
        J.append(i)
        if i != m//i:
            J.append(m//i)


J.sort()

N = int(len(J))
M = [1]

for i in range(1,N):
    cnt = 0
    for p in range(1,int(J[i]**0.5)+1):
        if J[i]%p == 0:
            cnt += 1
            if cnt >=2:
                break
    if icnt == 1:
        M.extend([J[i]])


M = int(len(M))

print(M)

### FIXED CODE ###

C,D = [int(e) for e in input().split()]

if C <= D:
    m = D
    n = C
else:
    m = C
    n = D

while  n != 0 :
    a = m%n
    m = n
    n = a

J = []

for i in range(1,int(m**0.5)+1):
    if m % i == 0:
        J.append(i)
        if i != m//i:
            J.append(m//i)


J.sort()

N = int(len(J))
M = [1]
I = []

for i in range(1,N):
    for p in range(1,int(J[i]**0.5)+1):
        if J[i]%p == 0:
            I.extend([J[i]])
            if int(len(I)) >=2:
                break
    if int(len(I)) == 1:
        M.extend([J[i]])
    I = []


M = int(len(M))

print(M)
a, b = list(map(int, imput().split()))
ans = 0
count = 1
if b == 1:
  print(ans)
else:
  while True:
    ans += 1
    count += a
    if count >= b:
      print(ans)
      break:
 

### FIXED CODE ###

a, b = list(map(int, input().split()))
ans = 0
count = 1
if b != 1:
    while count < b:
        count += a - 1
        ans += 1
print(ans)
import sys
import threading

sys.setrecursionlimit(2000000)
threading.stack_size(134217728)


class SearchProblem(object):
    def __init__(self, N, H):
        self.N = N
        self.H = H

    def isEnd(self, i):
        return i == self.N

    def succ(self, i):
        res = []
        if i + 1 <= self.N:
            res.append((i + 1, abs(self.H[i + 1] - self.H[i])))
        if i + 2 <= self.N:
            res.append((i + 2, abs(self.H[i + 2] - self.H[i])))
        return res


def solve(problem: SearchProblem):
    memo = {}

    def future_cost(s):
        if s in memo:
            return memo[s]

        if problem.isEnd(s):
            memo[s] = 0
            return 0
        else:
            memo[s] = min(
                cost + future_cost(next_state) for next_state, cost in problem.succ(s)
            )
            return memo[s]

    return future_cost(1)


def main():
    N = int(input())
    H = [None] + [int(x) for x in input().split(" ")]
    problem = SearchProblem(N, H)
    print(solve(problem))


if __name__ == "__main__":
    main_thread = threading.Thread(target=main)
    main_thread.start()
    main_thread.join()


### FIXED CODE ###

def solve(n):
    table = [0 for i in range(N + 1)]
    for i in range(1, n + 1):
        if i == 1:
            table[1] = 0
        elif i == 2:
            table[2] = abs(H[2] - H[1])
        else:
            table[i] = min(
                table[i - 1] + abs(H[i] - H[i - 1]), table[i - 2] + abs(H[i] - H[i - 2])
            )
    return table[n]


if __name__ == "__main__":
    N = int(input())
    H = [0] + [int(x) for x in input().split(" ")]

    print(solve(N))