Harryxun/stf_run huggingface dataset:
from collections import defaultdict
import sys
sys.setrecursionlimit(100001)
MOD = 1000000007

n = int(input())
alst = list(map(int, input().split()))
dic = defaultdict(list)
for i in range(n + 1):
    dic[alst[i]].append(i)

for v in dic.values():
    if len(v) == 2:
        left, right = v
        break

factMem = {}
def fact(x):
    if x <= 0:return 1
    if x in factMem:return factMem[x]
    factMem[x] = x * fact(x - 1) % MOD
    return factMem[x]

inverseMem = {}
def inverse(x):
    if x in inverseMem:return inverseMem[x]
    inverseMem[x] = pow(x, MOD - 2, MOD)
    return inverseMem[x]

def comb(x, y):
    if x < y:return 0
    return (fact(x) * inverse(fact(y)) * inverse(fact(x - y))) % MOD

for i in range(n + 1):
    print(comb(n + 1, i + 1) - comb(n - right + left, i))


### FIXED CODE ###

from collections import defaultdict

MOD = 1000000007

n = int(input())
alst = list(map(int, input().split()))
dic = defaultdict(list)
for i in range(n + 1):
    dic[alst[i]].append(i)

for v in dic.values():
    if len(v) == 2:
        left, right = v
        break

rem = n + 1 - (right - left + 1)


factMem = {}
def fact(x):
    if x <= 0:return 1
    if x in factMem:return factMem[x]
    factMem[x] = x * fact(x - 1) % MOD
    return factMem[x]

for x in range(n + 1):
    fact(x)

inverseMem = {}
def inverse(x):
    if x in inverseMem:return inverseMem[x]
    inverseMem[x] = pow(x, MOD - 2, MOD)
    return inverseMem[x]

def comb(x, y):
    if x < y or y < 0:return 0
    return (fact(x) * inverse(fact(y)) * inverse(fact(x - y))) % MOD

for i in range(n + 1):
    print((comb(n + 1, i + 1) - comb(rem, i)) % MOD)
n = int(input())
a = list(map(int, input().split()))

for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            break

print(ans)

### FIXED CODE ###

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

ans = "APPROVED"
for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            break

print(ans)
from heapq import heapify, heappop, heappush
from sys import stdin

N, M = map(int, input().split())
A = list(map(int, stdin.readline().split()))
heapify(A)
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, stdin.readline().split()))
BC = sorted(BC, key=lambda x: x[1], reversed=True)

print(BC)

enough = False
for bc in BC:
    if enough:
        break
    for i in range(bc[0]):
        if bc[1] <= A[0]:
            enough = True
            break
        heappop(A)
        heappush(A, bc[1])

print(sum(A))


### FIXED CODE ###

from heapq import heapify, heappop, heappush
from sys import stdin

N, M = map(int, input().split())
A = list(map(int, stdin.readline().split()))
heapify(A)
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, stdin.readline().split()))
BC = sorted(BC, key=lambda x: x[1], reverse=True)

enough = False
for bc in BC:
    if enough:
        break
    for i in range(bc[0]):
        if bc[1] <= A[0]:
            enough = True
            break
        heappop(A)
        heappush(A, bc[1])

print(sum(A))
# -*- coding: utf-8 -*-
# 18:01 -> 18:36 (give up. TLE)
from collections import deque

dx = [0,1,0,-1]
dy = [1,0,-1,0]

H, W = map(int, input().split())

A = []
black_deque = deque()

for i in range(H):
    A.append(list(input()))
    black_deque.extend([(i,j) for j in range(W) if A[i][j] == '#'])

for x,y in black_deque:
    A[x][y] = 0

n_white = H*W-len(black_deque)
while len(black_deque) != 0:
    x,y = black_deque.popleft()
    depth = A[x][y]
    tansaku = [(x+dx[k], y+dy[k]) for k in range(4)
        if 0 <= x+dx[k] < H and
           0 <= y+dy[k] < W and
           A[x+dx[k]][y+dy[k]] == '.'
    ]
    for new_x,new_y in tansaku:
        black_deque.append((new_x, new_y))
        n_while -= 1
        A[new_x][new_y] = depth+1
        if n_white == 0:
            print(depth+1)
            exit(0)

print(depth)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 18:01 -> 18:36 (give up. TLE)
from collections import deque

dx = [0,1,0,-1]
dy = [1,0,-1,0]

H, W = map(int, input().split())

A = []
black_deque = deque()

for i in range(H):
    A.append(list(input()))
    black_deque.extend([(i,j) for j in range(W) if A[i][j] == '#'])

if len(black_deque) == H*W:
    print(0)
    exit(0)

for x,y in black_deque:
    A[x][y] = 0

while len(black_deque) != 0:
    x,y = black_deque.popleft()
    depth = A[x][y]
    for k in range(4):
        new_x = x+dx[k]
        new_y = y+dy[k]
        if 0 <= new_x < H and \
           0 <= new_y < W and \
           A[new_x][new_y] == '.':
            black_deque.append((new_x, new_y))
            A[new_x][new_y] = depth+1

print(depth)
n, m = map(int, input().split())
D = [list() for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    D[a-1].append(b-1)
    D[b-1].append(a-1)
 
d = [0]*n
d[0] = 1
cnt = 0
 
 
def dfs(x):
    global cnt
    if all(d):
        cnt += 1
        return
    for i in D[x]:
        if d[i] == 0:
            d[i] = 1
            dfs(i)
            d[i] = 0
 
 
dfs(0)
print(cnt)
n, m = map(int, input().split())
D = [list() for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    D[a-1].append(b-1)
    D[b-1].append(a-1)
 
d = [0]*n
d[0] = 1
cnt = 0
 
 
def dfs(x):
    global cnt
    if all(d):
        cnt += 1
        return
    for i in D[x]:
        if d[i] == 0:
            d[i] = 1
            dfs(i)
            d[i] = 0
 
 
dfs(0)
print(cnt)

### FIXED CODE ###

N, M = map(int, input().split())
r = [[] * N for i in range(N)]
reached = [0] * N
reached[0] = 1
count = 0
 
def dfs(now):
    global count
    if all(reached):
        count += 1
    for next in r[now]:
        if reached[next] == 0:
            reached[next] = 1
            dfs(next)
            reached[next] = 0
 
for i in range(M):
    a, b = map(lambda x: int(x) - 1, input().split())
    r[a].append(b)
    r[b].append(a)
 
dfs(0)
 
print(count)
from math import factorial,sqrt,ceil,gcd

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

if abs(N-M)>=2:
    print(0)
    exit()

if N==M:
    ans = factorial(N) % MOD
    ans = ans * factorial(M) % MOD
    ans = ans * 2 % MOD  
    print(ans)
    exit()
elif N>M:
    ans = factorial(N) % MOD * factorial(M) % MOD
    print(ans)
    exit()
elif M>N:
    ans = factorial(M) % MOD * factorial(N) % MOD
    print(ans)
    exit()

### FIXED CODE ###

from math import factorial,sqrt,ceil #,gcd

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

if abs(N-M)>=2:
    print(0)
    exit()

if N==M:
    ans = factorial(N) % MOD
    ans = ans * factorial(M) % MOD
    ans = ans * 2 % MOD  
    print(ans)
    exit()
elif N>M:
    ans = factorial(N) % MOD * factorial(M) % MOD
    print(ans)
    exit()
elif M>N:
    ans = factorial(M) % MOD * factorial(N) % MOD
    print(ans)
    exit()
import numpy as np

N = int(input())
*A, = map(int, input().split())
A = np.array(A, dtype='int64')
C = np.diag([1 for _ in range(N)]) + np.diag([1 for _ in range(N-1)], k=1)
C[-1, 0] = 1
C = np.array(C, dtype='int64')
X = 2*np.linalg.solve(C, A)
X = list(map(int, X))
print(*X)

### FIXED CODE ###

N = int(input())
*A, = map(int, input().split())
X = [0]*N
X_total = sum(A)
A_odd = sum([A[i % N] for i in range(1, N, 2)])
A_even = sum([A[i % N] for i in range(2, N+1, 2)])
for i in range(N):
    X[i] = X_total - 2*(A_odd if i % 2 == 0 else A_even)
    if i % 2 == 0: A_odd += A[i] - A[(i+1) % N]
    else: A_even += A[i] - A[(i+1) % N]
print(*X)
import sys


fin = sys.stdin.readline
n = int(fin())
a_list = sorted(int(elem) for elem in fin().split())

num_elems = a_list[-1]
num_choices = -1
max_diff = float('-inf')
for a in a_list[:-1]:
    diff = min(num_elems - a, a)
    if diff > max_diff:
        num_choices = a
        max_diff = diff

print(num_elems, num_choices)


### FIXED CODE ###

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

if X < A:
    print("NO")
elif X > A + B:
    print("NO")
else:
    print("YES")
n = int(input())
A = [int(i) for i in input().split()]
A.insert(0, 0)

balls = list()
sums = dict()
# for i, a in enumerate(reversed(A)):
for bn in range(n, 0, -1):
    a = A[bn]
    if 2*bn > n:
        sums[bn] = a
        if a == 1:
            balls.append(str(bn))
    else:
        a2_sum = sums[2*bn]
        if a2_sum % 2 == a:
            # not
            sums[bn] = a2_sum
        else:
            # in
            sums[bn] = a2_sum + 1
            balls.append(str(bn))

all_balls = len(balls)
if all_balls % 2 != A[1]:
    print(-1)
else:
    print(all_balls)
    print(' '.join(balls))


### FIXED CODE ###

r = int(input())
print(3*r**2)
import numpy as np
N, M = map(int, input().split())
s, c = [], []
for i in range(M):
  tmp_s, tmp_c = map(int, input().split())
  s.append(tmp_s)
  c.append(tmp_c)

flag = 0
v_set = [999 for i in range(N)]
for i in range(M):
  if N == 1:	# 一桁のとき
    if v_set[0] == 999:
      v_set[0] = c[i]
      flag = 1
    elif v_set[0] != 999 and c[i] < v_set[0]:
      v_set[0] = c[i]
      flag = 1
  else:			# ２桁以上のとき
    if s[i] == 1 and c[i] == 0:
      flag = 0
      break
    elif v_set[s[i]-1] == 999:
      v_set[s[i]-1] = c[i]
      flag = 1
    elif v_set[s[i]-1] != 999 and c[i] < v_set[s[i]-1]:
      v_set[s[i]-1] = c[i]
      flag = 1
if flag == 0:
  print(-1)
else:
  for i in range(N):
    if v_set[i] == 999:
      v_set[i] = 0
  if N >= 2 and v_set[0] == 0:
    print(-1)
  else:
    print(str(int(v_set[0]))+str(int(v_set[1]))+str(int(v_set[2])))
  

### FIXED CODE ###

import numpy as np
N, M = map(int, input().split())
s, c = [], []
for i in range(M):
  tmp_s, tmp_c = map(int, input().split())
  s.append(tmp_s)
  c.append(tmp_c)

v_set = [999 for i in range(N)]
if N == 1:
  if M == 0:
    print(0)
  else:
    for i in range(M):
      if v_set[0] == 999 or v_set[0] == c[i]:
        v_set[0] = c[i]
      else:
        v_set[0] = -1
        break
    print(v_set[0])
elif N >= 2:
  for i in range(M):
    if v_set[s[i]-1] == 999 or v_set[s[i]-1] == c[i]:
      v_set[s[i]-1] = c[i]
    else:
      v_set[0] = 0
      break
  if v_set[0] == 0:
    print(-1)
  else:
    if v_set[0] == 999:
      v_set[0] = 1
    for i in range(1,N):
      if v_set[i] == 999:
        v_set[i] = 0
    out = ''
    for i in range(N):
      out += str(int(v_set[i]))
    print(out)
L = float(input())

ans = float((L/3)**3)

print(ans)

### FIXED CODE ###

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

ans = n * (n - 1) // 2 + m * (m - 1) // 2

print(ans)
import math
r=int(input())
area=r**2*math.pi
circumference=r*2*math.pi
print("{0:.5f} {1:.5f}".format(area,circumference))


### FIXED CODE ###

import math
r=float(input())
area=r**2*math.pi
circumference=r*2*math.pi
print("{0:.5f} {1:.5f}".format(area,circumference))
h, w = map(int, input().split())
INF = 10**5
MAP = ["."*(w+2)]
for _ in range(h):
    MAP.append("."+input()+".")
MAP.append("."*(w+2))
ROUTE = [[0]*(w+2) for _ in range(h+2)]
for i in range(2, w+1):
    ROUTE[0][i] = INF
    ROUTE[i][0] = INF

for i in range(1, h+1):
    for j in range(1, w+1):
        if MAP[i][j] == ".":
            x1 = ROUTE[i][j-1]
            x2 = ROUTE[i-1][j]
        else:
            if MAP[i][j-1] == "#":
                x1 = ROUTE[i][j-1]
            else:
                x1 = ROUTE[i][j-1]+1

            if MAP[i-1][j] == "#":
                x2 = ROUTE[i-1][j]
            else:
                x2 = ROUTE[i-1][j]+1
        ROUTE[i][j] = min(x1, x2)


print(ROUTE[h][w])


### FIXED CODE ###

h, w = map(int, input().split())
INF = 10**5
MAP = ["."*(w+2)]
for _ in range(h):
    MAP.append("."+input()+".")
MAP.append("."*(w+2))
ROUTE = [[0]*(w+2) for _ in range(h+2)]
for i in range(2, w+1):
    ROUTE[0][i] = INF
for i in range(2, h+1):
    ROUTE[i][0] = INF

for i in range(1, h+1):
    for j in range(1, w+1):
        if MAP[i][j] == ".":
            x1 = ROUTE[i][j-1]
            x2 = ROUTE[i-1][j]
        else:
            if MAP[i][j-1] == "#":
                x1 = ROUTE[i][j-1]
            else:
                x1 = ROUTE[i][j-1]+1

            if MAP[i-1][j] == "#":
                x2 = ROUTE[i-1][j]
            else:
                x2 = ROUTE[i-1][j]+1
        ROUTE[i][j] = min(x1, x2)


print(ROUTE[h][w])
n = int(input())
a = list(map(int, input().split()))
total = 0
for i in range(n):
    a[i] = a[i] - (i + 1)
if n % 2 == 0:
    ave = a[int(n/2)]
else:
    ave = int((a[int(n/2)] + a[int((n + 1)/2)]) / 2)
for i in range(n):
    total += abs(a[i] - ave)
print(total)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
total = 0
for i in range(n):
    a[i] = a[i] - (i + 1)
if n == 1:
    print(0)
    exit()
a.sort()
if n % 2 == 0:
    ave = a[int(n/2)]
    for i in range(n):
        total += abs(a[i] - ave)
    print(total)
else:
    total2 = 0
    ave = a[int(n/2)]
    for i in range(n):
        total += abs(a[i] - ave)
    ave = a[int((n + 1)/2)]
    for i in range(n):
        total2 += abs(a[i] - ave)
    if total2 >= total:
        print(total)
    else:
        print(total2)
#include <bits/stdc++.h>
using namespace std;

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> a(h);
    for (int i=0; i<h; i++) {
        cin >> a.at(i);
    }
    vector<bool> row(h, false);
    vector<bool> col(w, false);
    for (int i=0; i<h; i++) {
        for (int j=0; j<w; j++) {
            if (a.at(i).at(j) == '#') {
				row[i] = true;
				col[j] = true;
            }
        }
    }

	for (int i = 0; i < h; i++) {
		if (row[i]) {
			for (int j = 0; j < w; j++) {
				if (col[j]) {
					cout << a[i][j];
				}
			}
			cout << endl;
		}
	}    
}

### FIXED CODE ###

h, w = map(int, input().split())
a = [''] * h
for i in range(h):
	a[i] = input()

row = [False] * h
col = [False] * w
for i in range(h):
	for j in range(w):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True

for i in range(h):
	if row[i]:
		for j in range(w):
			if col[j]:
				print(a[i][j], end = '')
		print()
def slove():
    import sys
    import fractions
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    gcd = fractions.gcd(a, b)
    ls = [True] * (gcd + 1)
    ls[0] = False
    ls[1] = False
    c = [1]
    for i in range(2, int(len(ls) ** 0.5) + 1):
        if ls[i]:
            if a % i == 0 and b % i == 0:
                c.append(i)
            for j in range(i, len(ls), i):
                ls[j] = False
    print(len(c))


if __name__ == '__main__':
    slove()


### FIXED CODE ###

def slove():
    import sys
    import fractions
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    gcd = fractions.gcd(a, b)
    cnt = 1
    for i in range(2, int(gcd ** 0.5) + 1):
        if gcd % i == 0:
            cnt += 1
            while True:
                if gcd % i == 0:
                    gcd //= i
                else:
                    break
    if gcd != 1:
        cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()
S = input()
if S =  'ABC' :
    print( 'ARC' )
elif S =  'ARC' :
    print( 'ABC' )


### FIXED CODE ###

S = input()
if S ==  'ABC' :
    print( 'ARC' )
elif S ==  'ARC' :
    print( 'ABC' )
from math import floor

while True:
    e = int(input())
    if e == 0:
        break

    ans = 10 ** 10
    for z in range(floor(e ** (1 / 3)) + 1):
        ez = e - z ** 3
        if ez < 0:
            break
        for y in range(floor(ez ** (1 / 2)) + 1):
            x = ez - y ** 2
            if x < 0:
                break
            ans = min(ans, x + y + z)
    print (ans)


### FIXED CODE ###

from math import floor

while True:
    e = int(input())
    if e == 0:
        break

    ans = 10 ** 10
    z = 0
    while z ** 3 <= e:
        y = floor((e - z **3) ** 0.5)
        x = e - y ** 2 - z ** 3
        ans = min(ans, x + y + z)
        z += 1
    print (ans)
n = int(input())
x = input()
memo = {1:1, 2:1}
n1 = 0
for i in range(n):
    if x[i] == "1":
        n1 += 1
mup = [1]
mdown = [1]
for i in range(1, n):
    mup.append(mup[-1]*2%(n1+1))
    mdown.append(mdown[-1]*2%(n1-1))
mup.reverse()
mdown.reverse()
mmup = 0
mmdown = 0
for i in range(n):
    mmup = (mmup+mup[i]*int(x[i]))%(n1+1)
    mmdown = (mmdown+mdown[i]*int(x[i]))%(n1-1)
for i in range(n):
    if x[i] == "0":
        state = "up"
        n1i = n1+1
    else:
        state = "down"
        n1i = n1-1
    if state == "up":
        mm = (mmup+mup[i])%n1i
    else:
        mm = (mmdown-mdown[i])%n1i
    count = 1
    while mm > 0:
        if mm in memo:
            count += memo[mm]
            break;
        else:
            mmm = mm
            a = 0
            while mmm > 0:
                if mmm%2 == 1:
                    a += 1
                    mmm //= 2
            memo[mm] = a
            mm %= a
            count += 1
    print(count)

### FIXED CODE ###

n = int(input())
x = input()
memo = {0:0}
for i in range(1, n+1):
    j = i
    a = 0
    while True:
        if j in memo:
            memo[i] = memo[j]+a
            break;
        else:
            b = 0
            k = j
            while k > 0:
                if k%2 == 1:
                    b += 1
                k //= 2
            j %= b
            a += 1
n1 = 0
for i in range(n):
    if x[i] == "1":
        n1 += 1
if n1 > 1:
    mup = [1]
    mdown = [1]
    for i in range(1, n):
        mup.append(mup[-1]*2%(n1+1))
        mdown.append(mdown[-1]*2%(n1-1))
    mup.reverse()
    mdown.reverse()
    mmup = 0
    mmdown = 0
    for i in range(n):
        mmup = (mmup+mup[i]*int(x[i]))%(n1+1)
        mmdown = (mmdown+mdown[i]*int(x[i]))%(n1-1)
    for i in range(n):
        if x[i] == "0":
            state = "up"
            n1i = n1+1
        else:
            state = "down"
            n1i = n1-1
        if state == "up":
            mm = (mmup+mup[i])%n1i
        else:
            mm = (mmdown-mdown[i])%n1i
        print(memo[mm]+1)
elif n1 == 1:
    for i in range(n):
        if x[i] == "1":
            print(0)
        else:
            if x[-1] == "0" and i != n-1:
                print(1)
            else:
                print(2)
else:
    for i in range(n):
        print(1)
k=int(input())
A=[[1,1,1,1,1,1,1,1,1,1]]
for i in range(9):
    Ai=[]
    Ai.append(A[i][0]+A[i][1])
    for j in range(8):
        Ai.append(A[i][j]+A[i][j+1]+A[i][j+2])
    Ai.append(A[i][7]+A[i][8])
    A.append(Ai)
c=[]
for i in range(len(A)):
    c.append(sum(A[i][1:10]))
l=1 #length of number
while k>c[l-1]:
    k=k-c[l-1]
    l+=1
seq=[]

n=1 
while k>A[l-1][n]:
    k=k-A[l-1][n]
    n+=1
seq.append(n)#head number

for i in range(l-1):
    if seq[i]==0:
        j=0
        while k>A[l-2-i][j]:
            k=k-A[l-2-i][j]
            j+=1
        seq.append(j)
    else:
        j=seq[i]-1
        while k>A[l-2-i][j]:
            k=k-A[l-2-i][j]
            j+=1        
        seq.append(j)

for i in range(len(seq)):
    print(seq[i],end="")

### FIXED CODE ###

import queue

k=int(input())

q=queue.Queue()

for i in range(9):
    q.put(i+1)

c=1

for i in range(k):
    c=q.get()
    b=c%10
    if b!=0:
        q.put(10*c+b-1)
    q.put(10*c+b)
    if b!=9:
        q.put(10*c+b+1)

print(c)
import math

a,b,x=map(int,input().split())
M=x/a
if M<=a*b/2:
    A=M/b*2
    B=b
    C=(A**2+B**2)**0.5
    F=0
else:
    m=a*b-M
    A=a
    B=m/a*2
    C=(A**2+B**2)**0.5
    F=1

def get_angle_from_sides(a, b, c):
    return math.acos((a ** 2 + b ** 2 - c ** 2) / (2 * a * b))

def checkio(a, b, c):
    angles = [get_angle_from_sides(*abc) for abc in ((a, b, c), (b, c, a), (c, a, b))]
    result = sorted(math.degrees(a) for a in angles)
    return result
    

if F==0:
    print(checkio(A,B,C)[1])
else:
    print(checkio(A,B,C)[0])

### FIXED CODE ###

import math
a,b,x=map(int,input().split())

S=x/a

if S<=a*b/2:
    A=S/b*2
    B=b
    print(math.degrees(math.atan2(B,A)))
    
else:
    S=a*b-S
    A=a
    B=S/a*2
    print(90-math.degrees(math.atan2(A,B)))
#import numpy as np

N = int(input())
A = list(map(int, input().split()))
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

#K = int(input())
#S = input()

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
#mod = np.array([[-1 for i in range(N)] for i in range(N)])
#A = list(set(A))
A = sorted(A)#わるほう

kouho = list(A.copy())#わられるほう
target = sorted(list(set(A)))

kouho = [x for x in set(A) if A.count(x) == 1]
target = [x for x in set(A) if A.count(x) == 1]
            
for i in range(len(A)):
    if target == []:
        break
    maxN = int(max(target)/A[i])
    for n in range(2,maxN+1):
        if A[i]*n in kouho:
            kouho.remove(A[i]*n)
            #print(A[i]*n)
    target = list(kouho.copy())
        
print(len(target))

### FIXED CODE ###

X = list(map(int, input().split()))
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

#K = int(input())
#S = input()

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
#[[float("inf") for i in range(N)] for i in range(N)]

for i in range(len(X)):
    if X[i] == 0:
        break
    

print(i+1)
import sympy

n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        if len(sympy.divisors(i)) == 8:
            # print(i)
            count += 1
print(count)



### FIXED CODE ###

# import sympy

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        # if len(sympy.divisors(i)) == 8:
        if len(make_divisors(i)) == 8:
            count += 1
print(count)
N = int(input())
H = list(map(int,input().split()))
inf = 10**9+7
dp = [inf] * (N+10)
import numpy as np
for i,h in enumerate(H[:N-1]):
    dp[i+1] = min(dp[i+1],dp[i] + np.abs(h[i]-h[i+1]))
    if i>N-2: dp[i+2] = min(dp[i+2],dp[i] + np.abs(h[i]-h[i+2]))
    
print(dp[N-1])

### FIXED CODE ###

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

dp = [0] * 100010

dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2,N):
    dp[i] = min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2]) 
    
print(dp[N-1])