Harryxun/stf_run huggingface dataset:
if a >=13:
    print(b)
elif 6 <= a <= 12:
    print(b//2)
else:
    print(0)

### FIXED CODE ###

a,b=map(int,input().split())

if a>=13:
    print(b)
elif 12 >= a >= 6:
    print(b//2)
else:
    print(0)
import collections
N = int(input())
a = []
b = []
for i in range(int(N/2 + 0.1)):
    a.append(input().split())
    b.append(input().split())

ac = collections.Counter(a)
bc = collections.Counter(b)

a_1 = ac.most_common()[0]
b_1 = ac.most_common()[0]

a1_ans = N/2 - a_1[1]
b1_ans = N/2 - b_1[1]
if len(ac.most_common()) == 1:
    a2_ans = N/2
else:
    a2_ans = N/2 - ac.most_common()[1][1]
if len(bc.most_common()) == 1:
    b2_ans = N/2
else:
    b2_ans = N/2 - bc.most_common()[1][1]

if a_1[0] != b_1[0]:
    print(int(a1_ans + b1_ans))
else:
    print(int(max(a1_ans+b2_ans,b1_ans+a2_ans)))

### FIXED CODE ###

import collections

N = int(input())
a = list(int(i) for i in input().split())

b = a[::2]
c = a[1::2]

b_ =collections.Counter(b)
c_ =collections.Counter(c)

baa = b_.most_common()
caa = c_.most_common()

baa.append([0,0])
caa.append([0,0])

if baa[0][0] != caa[0][0]:
    print(N - baa[0][1] - caa[0][1])
else:
    print(min(N - baa[0][1] - caa[1][1],N - caa[0][1] - baa[1][1]))
a, b =input().split()
a = int(a)
b_100 = round(100 * b)
times = a * b_100
new_times = times / 100
print(new_times)

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=float(b)*1000
b=int(b)
print(int((a*b)//1000))
inport math
line = input().split(' ')
M = int(line[0])
N = int(line[1])
print(math.floor(M/N))

### FIXED CODE ###

import math
line = input().split(' ')
M = int(line[0])
N = int(line[1])
print(math.ceil(M/N))
s,t=input().split(" ")
a,b.=map(int,input().split(" "))
u=input()

if s==u:
  print(a-1,b)
else:
  print(a,b-1)

### FIXED CODE ###

s,t=input().split(" ")
a,b=map(int,input().split(" "))
u=input()
 
if s==u:
  print(a-1, b)
else:
  print(a, b-1)
import copy
n = int(input())
x = [int(y) for y in input().split()]
z = copy.deepcopy(x)
for i in range(n):
  x.pop(i)
  x.sort()
  print(x[int((n - 2) / 2)])
  x = z


### FIXED CODE ###

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

if a <= x and a + b >= x:
  print("YES")
else:
  print("NO")
n=input()
n=int(n)
if(n%10==7):
  print("Yes")
  else:
    print("No")

### FIXED CODE ###

n=input()
n=int(n)
og=n
flag=0
while(n>0):
    d=n%10
    n=n//10
    if(d==7):
        flag=flag+1
        
if(flag>0):
    print("Yes")
else:
    print("No")
def main():
    (a, b) = [int(i) for i in input().split()]
    print "%d %d %f" %(a / b, a % b, a / float(b))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    (a, b) = [int(i) for i in input().split()]
    print ("%d %d %f" %(a / b, a % b, a / float(b)))

if __name__ == '__main__':
    main()
import itertools


N, M = map(int, input().split())
connected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]
conditions = list(map(int, input().split()))

is_ok = 0
for patterns in itertools.product((0, 1), repeat=M):
    patterns = list(patterns)
    on_light = 0
    for i, light in enumerate(connected_switches):
        turned_sw = 0
        for switch_id in light:
            turned_sw += patterns[switch_id]
        if turned_sw % 2 == conditions[i]:
            on_light += 1
    if on_light == M:
        is_ok += 1

print(is_ok)


### FIXED CODE ###

import itertools


N, M = map(int, input().split())
connected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]
conditions = list(map(int, input().split()))

ok = 0
for patterns in itertools.product((0, 1), repeat=N):
    patterns = list(patterns)
    is_lighting = True
    for i, lights in enumerate(connected_switches):
        turned_sw = sum([patterns[x] for x in lights])
        if turned_sw % 2 != conditions[i]:
            is_lighting = False
            break
    if is_lighting:
        ok += 1

print(ok)
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3] or S[3]==S[4]:
  print('Bad')
else:
  print('Good')

### FIXED CODE ###

S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print('Bad')
else:
  print('Good')
a= input()
b= input()
c= input()
str = a[0] + b[0] + c[0]
print(str)

### FIXED CODE ###

S = input().split()
str = S[0][0] + S[1][0] + S[2][0]
print(str.upper())
# -*- coding: utf-8 -*-
import math

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

num = 0
for i in range(N):
    if ai[i] % 2 == 1:
        num += 1
    i += 1

print(i)

### FIXED CODE ###

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

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(N):
    if i % 2 == 0:
        if int(ai[i]) % 2 == 1:
            # print('asd' + str(i))
            # print('hoge' + str(ai[i*2]))
            num += 1

print(num)
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
a=[A-(T-H[i]*0.006) for i in range(0,N) if A-(T-H[i]*0.006)>=0]
b=[A-(T-H[i]*0.006) for i in range(0,N) if A-(T-H[i]*0.006)<0]
if a==[]:
  c=max(b)
elif b==[]:
  c=min(a)
elif min(a)>=-max(b):
  c=max(b)
else:
  c=min(a)
print(H.index((T-A+c)/0.006)+1)

### FIXED CODE ###

N=int(input())
T,A=map(int,input().split())
h=list(map(int,input().split()))
AA=[]
for i in range(N):
  a=T-h[i]*0.006-A
  if a<0:
    a*=-1
  AA.append(a)
print(AA.index(min(AA))+1)
while True:
    n = int(raw_input())

    if !n:
        break

    L = [int(raw_input()) for _ in range(n)]

    print (sum(L) - max(L) - min(L)) / (n - 2)



### FIXED CODE ###

while True:
    n = int(raw_input())

    if n == 0:
        break

    L = [int(raw_input()) for _ in range(n)]

    print (sum(L) - max(L) - min(L)) / (n - 2)
v

### FIXED CODE ###

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

def knapsack(n,w,wv):
    inf = float('inf')
    dp = [[-inf for _ in range(w+1)] for _ in range(n+1)]
    for i in range(w+1): dp[0][i] = 0

    for i in range(n):
        for w in range(w+1):
            if wv[i][0]<=w:
                dp[i+1][w] = max(dp[i][w-wv[i][0]]+wv[i][1],dp[i][w])
            else:
                dp[i+1][w] = dp[i][w]
    return dp[n][w]

print(knapsack(n,w,wv))
n = int(input())
s = input()
x = int(s, 2)
p = s.count("1")
pre0, pre1 = x%(p-1), x%(p+1)

nxt = [i for i in range(n+1)]
for i in range(1, n):
	nxt[i] %= bin(i).count("1")

for i in range(n):
	if x == 1<<(n-1-i):
		print(0)
		continue
	if s[i] == "0":
		tmp = (pre1 + pow(2, n-1-i, p+1)) % (p+1)
	else:
		tmp = (pre0 - pow(2, n-1-i, p-1)) % (p-1)
	ans = 1
	while tmp > 0:
		ans += 1
		tmp = nxt[tmp]
	print(ans)

### FIXED CODE ###

n = int(input())
s = input()
x = int(s, 2)
p = s.count("1")
if p > 1:
	pre0 = x%(p-1)
pre1 = x%(p+1)

nxt = [i for i in range(n+10)]
for i in range(1, n+10):
	nxt[i] %= bin(i).count("1")

for i in range(n):
	if x == 1<<(n-1-i):
		print(0)
		continue
	if s[i] == "0":
		tmp = (pre1 + pow(2, n-1-i, p+1)) % (p+1)
	else:
		tmp = (pre0 - pow(2, n-1-i, p-1)) % (p-1)
	ans = 1
	while tmp > 0:
		ans += 1
		tmp = nxt[tmp]
	print(ans)
import sys
count = 1
While True:
  x = sys.stdin.readline().strip()
  if x == "0":
    break
  print("Case %d: %s" %(count,x))
  count = count + 1

### FIXED CODE ###

import sys
count = 1
while True:
  x = sys.stdin.readline().strip()
  if x == "0":
    break
  print("Case %d: %s" %(count,x))
  count = count + 1
class UnionFind:
    """size(int)を指定
    root(x:int)->int:      根を求める
    unite(x,y:int):        要素をグループにまとめる 
    isSame(x,y:int)->bool: 要素同士が同じグループか判定する
    """
    # 分離はできない
    # 始め各要素は別々のグループ  
    def __init__(self,n):
        self.par = [-1]*n # 親の番号
        self.size = [1]*n
        for i in range(n):
            self.par[i] = i  # はじめ すべての頂点が根
    
    def root(self, x: int) -> int:
        """根を求める"""
        if self.par[x] == x: # if root
            return x
        else:
            self.par[x] = self.root(self.par[x]) # 経路圧縮
            return self.par[x]
    
    def isSame(self, x:int, y:int)->bool:
        """x と y が同じ集合に属するか否か"""
        return self.root(x)==self.root(y)
    
    def unite(self, x:int, y:int):
        """x と y の属する集合を併合"""
        x = self.root(x)
        y = self.root(y)
        if x == y: return
        self.par[x] = y
        self.size[y] += self.size[x]
        self.size[x] = 0
        
    def getsize(self, x:int):
        return self.size[self.root(x)]
        
N,M = map(int, input().split())
ab = tuple(tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M))

def comb2(n):
    if n==0: return 0
    return n*(n-1)//2

uf = UnionFind(N)
ans = []
nex = comb2(N)

for ai,bi in reversed(ab):
    ans.append(nex)
    sa = uf.getsize(ai)
    sb = uf.getsize(bi)
    nex = ans[-1] + comb2(sa) + comb2(sb)
    uf.unite(ai,bi)
    nex -= comb2(uf.getsize(ai))
    

for a in reversed(ans):
    print(a)

### FIXED CODE ###

#UnionFindクラス
class UnionFind:
    def __init__(self,n):
        self.par =  [i for i in range(n)]
        self.rank = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # xとyの根を結合させる
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y: return
        if self.rank[x] < self.rank[y]:
            x, y = y, x
        self.rank[x] += self.rank[y]
        self.par[y] = x

    # x,yの根が同じかどうかを返す（根が同じ:True、根が異なる:False）
    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    # xが含まれる木の要素数を返す
    def size(self, x):
        return self.rank[self.find(x)]
    
n,m = map(int,input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(m)]
uf = UnionFind(n)
accm = []
for ai,bi in reversed(ab):
    if uf.is_same(ai,bi):
        accm.append(0)
    else:
        accm.append(uf.size(ai)*uf.size(bi))
    uf.union(ai,bi)

accm = accm[::-1]
for i in range(1,len(accm)):
    accm[i] += accm[i-1]
for a in accm:
    print(a)
H,W = input().split()
H,W = int(H),int(W)
nodes = [list(input()) for i in range(H)]


if H == 1 and W == 1 and nodes[0][0] == ".":
    print("No")
    quit()

for i in range(len(nodes)):
    for j in range(len(nodes)):
        if nodes[i][j] == "#":
            flag = False
            if i - 1 >= 0:
                if nodes[i-1][j] == "#":
                    flag = True
            if i + 1 < H:
                if nodes[i+1][j] == "#":
                    flag = True
            if j - 1 >= 0:
                if nodes[i][j-1] == "#":
                    flag = True
            if j + 1 < W:
                if nodes[i][j+1] == "#":
                    flag = True

            if flag == False:
                print("No")
                quit()

print("Yes")

### FIXED CODE ###

H,W = input().split()
H,W = int(H),int(W)
nodes = [list(input()) for i in range(H)]


if H == 1 and W == 1 and nodes[0][0] == ".":
    print("No")
    quit()
if H == 1 and W == 1 and nodes[0][0] == "#":
    print("Yes")
    quit()


for i in range(H):
    for j in range(W):
        if nodes[i][j] == "#":
            flag = False
            if i - 1 >= 0:
                if nodes[i-1][j] == "#":
                    flag = True
            if i + 1 < H:
                if nodes[i+1][j] == "#":
                    flag = True
            if j - 1 >= 0:
                if nodes[i][j-1] == "#":
                    flag = True
            if j + 1 < W:
                if nodes[i][j+1] == "#":
                    flag = True

            if flag == False:
                print("No")
                quit()

print("Yes")
from collections import defaultdict
N,M = map(int,input().split())
d = defaultdict(int)
for i in range(2, floor(sqrt(M))+1):
    while M % i == 0:
        d[i] += 1
        M //= i
if M != 1:
    d[M] += 1
def comb(n,k):
    if k == 0:
        return 1
    return comb(n-1,k-1) * n // k
ans = 1
for e in d.values():
    ans *= comb(N+e-1, e)
print(ans % (10**9+7))

### FIXED CODE ###

from math import sqrt, floor
from collections import defaultdict
def comb(n,m):
    if m == 0:
        return 1
    return comb(n-1,m-1)*n // m
def facts(n):
    dic = defaultdict(int)
    for i in range(2,floor(sqrt(n))+1):
        while n % i == 0:
            n //= i
            dic[i] += 1
        if n == 1:
            break
    if n != 1:
        dic[n] += 1
    return dic
N, M = map(int,input().split())
mod = 10**9+7
ans = 1
dic = facts(M)
for p in dic:
    ans = (ans*(comb(dic[p]+N-1, dic[p]) % mod)) % mod
print(ans)
N = int(input())
lis=[0 for i in range(N)]
for i in range(N):
    lis[i]=(int(input()))

def Euc(x,y):
    s=0;b=0;rem=0;
    if x>y:
        s=y;b=x
    elif y>x:
        s=x;b=y
    else:
        return int(x)
    while True:
        rem = b%s
        if rem == 0:
            return int(x*y/s)
        b = s
        s = rem
a = lis[0]
for i in range(N-1):
    a = Euc(a,lis[i+1])
print(a)


### FIXED CODE ###

def koubai(a,b):
    if b==0:
        return a
    return(koubai(b,a%b))
def kouyaku(a,b):
    return a*b//koubai(a,b)

N=int(input())
if N==1:
    print(int(input()))
    exit()
ans=1
for i in range(N):
    ans=kouyaku(ans,int(input()))
print(int(ans))
def max_minus_min(areas):
    # print("areas", areas)
    return max(areas) - min(areas)
 
def solve2(h, w):
    area1 = h * (w // 2)
    area2 = h * w - area1
    return [area1, area2]
 
def solve(h, w):
    w_div_3 = w // 3;
    ans = 1e9
    for w2 in range(w_div_3, w_div_3 + 2):
        area1 = w2 * h

        tmp = solve2(h, w - w2)
        ans = min(ans, max_minus_min([area1, tmp[0], tmp[1]])

        tmp = solve2(w - w2, h)
        ans = min(ans, max_minus_min([area1, tmp[0], tmp[1]])
    return ans
 
H, W = map(int, input().split())
print(min(solve(H,W), solve(W,H)))


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# import array
# from bisect import *
# from collections import *
# import fractions
# import heapq 
# from itertools import *
# import math
# import re
# import string

def max_minus_min(areas):
    # print("areas", areas)
    return max(areas) - min(areas)

def solve2(h, w):
    area1 = h * (w // 2)
    area2 = h * w - area1
    return [area1, area2]

def solve(h, w):
    w_div_3 = w // 3;
    ans = 1e9
    for w2 in range(w_div_3, w_div_3 + 2):
        area1 = w2 * h
        ans = min(ans, max_minus_min([area1] + solve2(h, w - w2)))
        ans = min(ans, max_minus_min([area1] + solve2(w - w2, h)))
    return ans

H, W = map(int, raw_input().split())
print(min(solve(H,W), solve(W,H)))
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll a[n+1];
	ll b[m+1];
	a[0]=0;
	b[0]=0;
	for(ll i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(ll i=1;i<=m;i++)
	{
		cin>>b[i];
		b[i]+=b[i-1];
	}
	ll j=m;
	ll ans=0;
	for(ll i=1;i<=n;i++)
	{
		if(a[i]>k)break;
		while(j>=0 && a[i]+b[j]>k)
		{
			j--;
		}
		if(j>=0)
		ans=max(ans,i+j);
	}
	cout<<ans;
	return 0;
}

### FIXED CODE ###

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

a, b = [0], [0]
for i in range(N):
	a.append(a[i] + A[i])
for i in range(M):
	b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
	if a[i] > K:
		break
	while b[j] > K - a[i]:
		j -= 1
	ans = max(ans, i + j)
print(ans)
a, b, c, d = map(int, input().split())

while:
  c = c - b
  if c <= 0:
    print('Yes')
    break
  a = a - d
  if a <= 0:
    print('No')
    break

### FIXED CODE ###

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

while True:
  c = c - b
  if c <= 0:
    print("Yes")
    break
  a = a - d
  if a <= 0:
    print("No")
    break
import sys
import math

def main():
    input = sys.stdin.readline
    #1行に複数の入力の時は.split()使う
    AB = input().split()
    A, B = int(AB[0]), B = int(AB[0].replace(".",""))
    print(A*B // 100)
    return


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import math

def main():
    input = sys.stdin.readline
    #1行に複数の入力の時は.split()使う
    AB = input().split()
    A, B = int(AB[0]),int(AB[1].replace(".",""))
    print(A*B // 100)
    return


if __name__ == '__main__':
    main()
N = int(input())
A, B, C = [list(map(int, input().split())) for _ in range(3)]
score=0
pred_i=np.inf
for i in A:
    if pred_i+1 ==i:
        score=score+C[i-2]+B[i-1]
    else:
        score+=B[i-1]
    pred_i=i
print(score)

### FIXED CODE ###

import numpy as np
N = int(input())
A, B, C = [list(map(int, input().split())) for _ in range(3)]
score=0
pred_i=np.inf
for i in A:
    if pred_i+1 ==i:
        score=score+C[i-2]+B[i-1]
    else:
        score+=B[i-1]
    pred_i=i
print(score)
num=1000000
prime=[1]*1000000
prime[0]=0
prime[1]=0
i=2
ans=0
while i<1000000:
 if prime[i]==1:
  ans+=1
 if i<1000:
  j=i*i
  while j<1000000:
   prime[j]=0
   j+=i
 prime[i]=ans
 i+=1
while True:
 try:
  n=input():
  print prime[n]
 except:
  break

### FIXED CODE ###

num=1000000
prime=[1]*1000000
prime[0]=0
prime[1]=0
i=2
ans=0
while i<1000000:
 if prime[i]==1:
  ans+=1
 if i<1000:
  j=i*i
  while j<1000000:
   prime[j]=0
   j+=i
 prime[i]=ans
 i+=1
while True:
 try:
  n=input()
  print prime[n]
 except:
  break
# cook your dish here
import numpy as np
n =int(input())
a = list(map(int,input().split()))	


d = np.ones((n,n))

c = 0

if n == 1:
    if a[0]== 0:
        print(1)
    else:
        print(0)
    quit()

for i in range(0,n):
    d[0][i] = sum(a[:i+1:])
    if d[0][i] == 0:
        c += 1
for t in range(0,n-1):
    s = 0
    while s <=t:
        d[s+1][t+1] = d[s][t]-a[s]+a[t+1]
        if d[s+1][t+1] == 0:
            c += 1
        s += 1


print(c)

### FIXED CODE ###

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

c = 0

s = [a[0]]
for i in range(1,n):
    s.append(s[-1]+a[i])

#print(s)
s.sort()
#print(s)

k=1
for i in range(1,n):
    if s[i]==s[i-1]:
        k += 1
    else:
        if k != 1:
            c += k*(k-1)//2
        k = 1
    if i == n-1 and k != 1:
         c += k*(k-1)//2
        
c += s.count(0)
print(c)
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort()
q.sort()
r.sort()

ans = 0
for i in range(x):
    if p[-1] >= r[-1]:
        ans += p.pop()
    else:
        ans += r.pop()

for i in range(y):
    if q[-1] >= r[-1]:
        ans += q.pop()
    else:
        ans += r.pop()

print(ans)

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort()
q.sort()
r.sort()

ans = 0
while x != 0 or y != 0:
    if r != []:
        if x > 0 and y > 0:
            maxi = max(p[-1], q[-1], r[-1])
            if maxi == p[-1]:
                ans += p.pop()
                x -= 1
            elif maxi == q[-1]:
                ans += q.pop()
                y -= 1
            else:
                ans += r.pop()
                if p[-x] > q[-y]:
                    y -= 1
                else:
                    x -= 1
        elif x == 0:
            maxi = max(q[-1], r[-1])
            if maxi == q[-1]:
                ans += q.pop()
                y -= 1
            else:
                ans += r.pop()
                y -= 1
        else:
            maxi = max(p[-1], r[-1])
            if maxi == p[-1]:
                ans += p.pop()
                x -= 1
            else:
                ans += r.pop()
                x -= 1
    else:
        if x > 0 and y > 0:
            maxi = max(p[-1], q[-1])
            if maxi == p[-1]:
                ans += p.pop()
                x -= 1
            elif maxi == q[-1]:
                ans += q.pop()
                y -= 1
        elif x == 0:
            ans += q.pop()
            y -= 1
        else:
            ans += p.pop()
            x -= 1

print(ans)
a, b = map(int, input().split())
s = input()

print(s[0:k-1] + s[k-1].lower() + s[k, a])


### FIXED CODE ###

a, b = map(int, input().split())
s = input()

print(s[:b-1] + s[b-1].lower() + s[b:])
import string
S = input()
N = len(S)
assert(len(S) <= 100)

for i in range(N):
    for j in range(i, N):
        s = S[i:j+1]
        if len(s) > 1 and any(s.count(a) * 2 > j-i+1 for a in string.ascii_lowercase):
            print(i+1, j+1)
            quit(0)
print(-1, -1)


### FIXED CODE ###

import string
S = input()
N = len(S)

for i in range(N):
    if i < N-1 and S[i] == S[i+1]:
        print(i+1, i+2)
        quit()
    elif i < N-2 and S[i] == S[i+2]:
        print(i+1, i+3)
        quit()
print(-1, -1)
def main()
  N=input()
  A=sorted(map(int,input().split()))
  M=A[-1]+1
  B=[0]*M
  for i in A:
    B[i]+=1
    if B[i]==1:
      for j in range(i*2,M,i):
        B[j]=2
  print(B.count(1))
main()

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)
from functools import lru_cache

n = int(input())
list1 = [''.join(sorted(input())) for i in range(n)]
dict1 = dict()
cout = 0
@lru_cache(maxsize = None)
def func(s):
	if s == 2:
		return 1 #2個の場合は1パターン
	return s-1 + func(s-1)

for i in range(n):
	if list1[i] in dict1:
		dict1[list1[i]] += 1
	else:
		dict1[list1[i]] = 1

for i in dict1:
	if dict1[i] != 1:
		cout += func(dict1[i])

print(cout)


### FIXED CODE ###

a,b = map(int,input().split())
list1 = []
list1.append(a+b)
list1.append(a-b)
list1.append(a*b)
print(max(list1))
x = int(input())
A = int(input())
B = int(input()9

print((x - A) % B)


### FIXED CODE ###

x = int(input())
A = int(input())
B = int(input())

print((x - A) % B)
a = input()
print('No' if int(a) % sum(map(int,a)) else 'Yes')

### FIXED CODE ###

S = input()
print(S.count('+') - S.count('-'))
a,b=map(int,input().split)
print((a-1)*(b-1))

### FIXED CODE ###

a,b=map(int,input().split())
print((a-1)*(b-1))
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
tour=[0]
visited=[0]*n
visited[0]=1
next_town = 0
flag=False
for i in range(n):
    next_town=A[next_town]-1
    if i==k:
        flag = True
        ans = next_town
    if next_town==0:
        first_roop_idx = 0
        break
    if visited[next_town]>0:
        first_roop_idx = visited[next_town]
        break
    tour.append(next_town)
    visited[next_town]=i+1
#print(tour)
#print(visited)
#print(first_roop_idx)
if not flag:
    if k<=len(tour):
        ans = tour[k]
    else:
        k-=first_roop_idx
        #print("k=",k)
        k=k%(len(tour)-first_roop_idx)
        #print("k=",k)
        ans = tour[first_roop_idx+k]
print(ans+1)


### FIXED CODE ###

n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
tour=[0]
visited=[0]*n
visited[0]=1
next_town = 0
flag=False
for i in range(n):
    next_town=A[next_town]-1
    if i+1==k:
        flag = True
        ans = next_town
        break
    if next_town==0:
        first_roop_idx = 0
        break
    if visited[next_town]>0:
        first_roop_idx = visited[next_town]
        break
    tour.append(next_town)
    visited[next_town]=i+1
#print(tour)
#print(visited)
#print(first_roop_idx)
if not flag:
    if k<=len(tour):
        ans = tour[k]
    else:
        k-=first_roop_idx
        #print("k=",k)
        if len(tour)-first_roop_idx==0:
            k=0
        else:k=k%(len(tour)-first_roop_idx)
        #print("k=",k)
        ans = tour[first_roop_idx+k]
print(ans+1)
#print(flag)
n=input()
p=list(map(int,input().split()))
result=[]
for i in range(n-1):
    s1 = sum(p[:i+1])
    s2 = sum(p[i+1:])
    result.append(abs(s1-s2))
resultd = sorted(result)
print(resultd[0])

### FIXED CODE ###

n=int(input())
p = list(map(int,input().split()))
result=sum(p)
for i in range(n-1):
    s1 = sum(p[:i+1])
    s2 = sum(p[i+1:])
    result = min(result,abs(s1-s2))
print(result)