Harryxun/stf_run huggingface dataset:
#累積和　AGC023
from collections import Counter
from math import factorial
def nC2(n):
    if n >= 2:
        return  factorial(n) / factorial(2) / factorial(n - 2) 
    else:
        return 0    
N = int(input())
A = list(map(int,input().split()))
B = [0]
ans = 0
for i in range(N):
    B.append(A[i] + B[i])
C = Counter(B)
for v in C.values():
    ans += nC2(v)
print(int(ans)) 

### FIXED CODE ###

#累積和　AGC023
from collections import Counter
from math import factorial
def nC2(n):
    if n >= 2:
        return factorial(n) // (factorial(n-2)*factorial(2))
    else:
        return 0
N = int(input())
A = list(map(int,input().split()))
B = [0]
ans = 0
for i in range(N):
    B.append(A[i] + B[i])
C =Counter(B)

for v in C.values():
    ans += nC2(v)
print(ans)
from collections import deque
a,b,c=[int(_) for _ in input().split()]
k=c-1
s=math.floor((k*a)/b)-a*math.floor(k/b)
t=math.floor((c*a)/b)-a*math.floor(c/b)
if b<c:
    l=b-1
    g=b
    v=math.floor((l*a)/b)-a*math.floor(l/b)
    m=math.floor((g*a)/b)-a*math.floor(g/b)
    print(s,t,m,v)
else:
    print(max(s,t))

### FIXED CODE ###

import math
from collections import deque
a,b,c=[int(_) for _ in input().split()]
if c>=b:
    k=b-1    
else:
    k=c
s=math.floor((k*a)/b)-a*math.floor(k/b)
print(s)
x = input()
y = x % 11
if y > 0:
    cnt = 1
    if y > 6:
        cnt += 1
else:
    cnt = 0
    
print(x // 11 + cnt)


### FIXED CODE ###

x = int(input())
y = x % 11
if y > 0:
    cnt = 1
    if y > 6:
        cnt += 1
else:
    cnt = 0
    
print((x // 11) * 2 + cnt)
def popcount(n):
    bit_count = bin(n).count('1')
    n = n % bit_count 
    return n

if __name__ == "__main__":
    import sys 

    readline = sys.stdin.readline 

    N = int(input())
    X = readline()
    bit_count = X.count('1')
    X_int = int(X, 2)


    for i in range(N):
        # ビットの反転
        X_int_copy = X_int
        bit_count_n = bit_count
        if X[i] == '0':
            bit_count_n += 1
            X_int_copy += pow(2, N - 1 - i)
        else:
            bit_count_n -= 1
            X_int_copy -= pow(2, N - 1 - i)

        # print("反転後{}".format(X_int_copy))
        # ビット反転後に0になった場合
        if X_int_copy == 0:
            print(0)

        # 1回操作しておく
        popcount_X = X_int_copy % bit_count_n 
        counter = 1
        while popcount_X != 0:
            popcount_X = popcount(popcount_X)
            counter += 1

        print(counter)






### FIXED CODE ###

def popcount(n):
    bit_count = bin(n).count('1')
    n = n % bit_count 
    return n

if __name__ == "__main__":
    import sys 

    readline = sys.stdin.readline 

    N = int(input())
    X = readline()
    bit_count = X.count('1')
    mod1 = int(X, 2) % (bit_count + 1)
    mod2 = int(X, 2) % (bit_count - 1) if (bit_count - 1) != 0 else 0

    for i in range(N):
        if X[i] == '0':
            X_rest = (mod1 + pow(2, N - 1 - i, bit_count + 1)) % (bit_count + 1)
        else:
            if bit_count - 1 != 0:
                X_rest = (mod2 - pow(2, N - 1 - i, bit_count - 1)) % (bit_count - 1)
            else:
                print(0)
                continue

        counter = 1
        while X_rest != 0:
            X_rest = popcount(X_rest)
            counter += 1
        print(counter)
o = input()
e = input()
if len(o) > len(e):
  a = o[0]+e[0]
  for i in range(1,len(e)):
    a += o[i] + e[i]
  print(a+o[-1])
if len(o) == len(e):
  a = o[0]+e[0]
  for i in range(1,len(e)):
    a += o[i] + e[i]
  print(a)
else:
  a = e[0]+o[0]
  for i in range(1,len(o)):
    a += e[i] + o[i]
  print(a+e[-1])

### FIXED CODE ###

o = input()
e = input()
if len(o) > len(e):
  a = o[0]+e[0]
  for i in range(1,len(e)):
    a += o[i] + e[i]
  print(a+o[-1])
elif len(o) == len(e):
  a = o[0]+e[0]
  for i in range(1,len(e)):
    a += o[i] + e[i]
  print(a)
else:
  a = e[0]+o[0]
  for i in range(1,len(o)):
    a += e[i] + o[i]
  print(a+e[-1])
N,L = map(int,input().split())
S = sorted([input() for i in range(n)])
print(*s,sep = "")


### FIXED CODE ###

N,L = map(int,input().split())
S = sorted([input() for i in range(N)])
print(*S,sep = "")
while True:
    n = input()
    if n == 0:
        break
    dic = {}
    for _ in xrange(n):
        name, cost = raw_input().split()
        dic[name] = int(cost)
    for _ in xrange(input()):
        items = raw_input().split()
        if items[1] == 0:
            continue
        if items[0] not in dic:
            dic[items[0]] = sum(map(lambda x:dic[x], items[2:]))
        else:
            dic[items[0]] = min(dic[items[0]], sum(map(lambda x:dic[x], items[2:])))
    print dic[raw_input()]

### FIXED CODE ###

INF = 1 << 29
while True:
    n = input()
    if n == 0:
        break
    dic = {}
    for _ in xrange(n):
        name, cost = raw_input().split()
        dic[name] = int(cost)
    m = input()
    recipe = []
    for _ in xrange(m):
        data = raw_input().split()
        if data[1] <= 0:
            m -= 1
            continue
        recipe.append([data[0]]+data[2:])
    for _ in xrange(m):
        for i in xrange(m):
            dic[recipe[i][0]] = min(dic[recipe[i][0]] if recipe[i][0] in dic else INF, 
                                    sum(map(lambda x:dic[x] if x in dic else INF, recipe[i][1:])))
    print dic[raw_input()]
n, m = map(int, input().split())
p = list(map(lambda x: int(x) - 1, input().split()))
xy = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]

par = [i for i in range(n)]
rank = [0 for _ in range(n)]


def root(x):
    if par[x] == x:
        return x
    par[x] = root(par[x])
    return par[x]


def is_same(x, y):
    return root(x) == root(y)


def union(x, y):
    x = root(x)
    y = root(y)
    if x == y:
        return
    if rank[x] < rank[y]:
        par[x] = y
    else:
        par[y] = x
        if rank[x] == rank[y]:
            rank[x] += 1


for x, y in xy:
    union(x, y)

count = 0
for i, p_i in enumerate(p):
    count += 1 if is_same(i, p_i) else 0
print(count)


### FIXED CODE ###

n, m = map(int, input().split())
p = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

par = [i for i in range(n)]
rank = [1 for _ in range(n)]


def root(x):
    if x == par[x]:
        return x
    par[x] = root(par[x])
    return par[x]


def is_same(x, y):
    return root(x) == root(y)


def unite(x, y):
    x = root(x)
    y = root(y)
    if x == y:
        return
    par[x] = y


for x, y in xy:
    unite(x - 1, y - 1)


count = 0
for i, p_i in enumerate(p):
    count += 1 if is_same(i, p_i - 1) else 0
print(count)
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

cnt = 0  
for n in range(1,N+1):
  if len(make_divisiors(n)) == 8:
    cnt += 1
print(cnt)

### FIXED CODE ###

N = int(input())
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    return divisors
 
cnt = 0  
for n in range(1,N+1):
    if len(make_divisors(n)) == 8 and n%2==1:
        cnt += 1
print(cnt)
def gcd(n,m):
    while n:
        m,n = [n,m%n]
    return m

def prime(N):
    se = [0,0,1]+[1]*(N-2)
    n = 2
    while n ** 2 <= N:
        if se[n]:
            nn = 2*n
            while nn <= N:
                se[nn] = 0
                nn += n
        n += 1

    return [x for x in range(0,N+1) if se[x]]

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

S = gcd(A,B)

s = 1
for i in prime(S):
    hoge = 0
    while S % i == 0:
        hoge += 1
        S //= i
    if hoge:
        s += 1

print(s)

### FIXED CODE ###

def gcd(n,m):
    while n:
        m,n = [n,m%n]
    return m

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

S = gcd(A,B)

s = 1
i = 2
while True:
    if S == 1:
        break
    if i ** 2 >= S:
        break
    hoge = 0
    while S % i == 0:
        hoge += 1
        S //= i
    if hoge:
        s += 1
    i += 1

print(s + (S != 1))
from math import pi
r = int(input())
print('{0:.5f} {1:.5f}'.format(r*r*pi,r*2*pi))

### FIXED CODE ###

from math import pi
r = float(input())
print('{:.5f} {:.5f}'.format(r*r*pi,r*2*pi))
import queue
sys.setrecursionlimit(10**7)
N, Q = map(int, input().split())

edges = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

points = [0]*N
PX = [list(map(int, input().split())) for _ in range(Q)]
for px in PX:
    points[px[0]-1] += px[1]

def dfs(v, par):
    for nv in edges[v]:
        if nv == par:
            continue
        points[nv] += points[v]
        dfs(nv, v)

dfs(0, -1)

print(*points)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
N, Q = map(int, input().split())

edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

points = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    points[p-1] += x

def dfs(v, par):
    for nv in edges[v]:
        if nv == par:
            continue
        points[nv] += points[v]
        dfs(nv, v)

dfs(0, -1)

print(*points)
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
N = int(input())
numbers = list()
for i in range(N):
    numbers.append(int(input()))

bingo = False
for a in A:
    if a not in numbers:
        break
else:
    bingo = True

for b in B:
    if b not in numbers:
        break
else:
    bingo = True

for c in C:
    if c not in numbers:
        break
else:
    bingo = True

columnA = [A[0],B[0],C[0]]
for i in columnA:
    if i not in numbers:
        break
else:
    bingo = True

columnB = [A[1],B[1],C[1]]
for i in columnB:
    if i not in numbers:
        break
else:
    bingo = True

columnC = [A[2],B[2],C[2]]
for i in columnB:
    if i not in numbers:
        break
else:
    bingo = True

diagA = [A[0],B[1],C[2]]
for i in diagA:
    if i not in numbers:
        break
else:
    bingo = True

diagB = [A[3],B[2],C[1]]
for i in diagB:
    if i not in numbers:
        break
else:
    bingo = True

print("Yes" if bingo else "No")

### FIXED CODE ###

A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
N = int(input())
numbers = list()
for i in range(N):
    numbers.append(int(input()))

bingo = False
for a in A:
    if a not in numbers:
        break
else:
    bingo = True

for b in B:
    if b not in numbers:
        break
else:
    bingo = True

for c in C:
    if c not in numbers:
        break
else:
    bingo = True

columnA = [A[0],B[0],C[0]]
for i in columnA:
    if i not in numbers:
        break
else:
    bingo = True

columnB = [A[1],B[1],C[1]]
for i in columnB:
    if i not in numbers:
        break
else:
    bingo = True

columnC = [A[2],B[2],C[2]]
for i in columnC:
    if i not in numbers:
        break
else:
    bingo = True

diagA = [A[0],B[1],C[2]]
for i in diagA:
    if i not in numbers:
        break
else:
    bingo = True

diagB = [A[2],B[1],C[0]]
for i in diagB:
    if i not in numbers:
        break
else:
    bingo = True

print("Yes" if bingo else "No")
n, m = list(map(int, input().split()))
ps = []
for i in range(m):
    tmp = input().split()
    ps.append([int(tmp[0]), tmp[1]])

ac = [False] * n
wa = [0] * n
for i in range(m):
    if not ac[ps[i][0]]:
        if ps[i][1] == "WA":
            wa[ps[i][0]] += 1
        elif ps[i][1] == "AC":
            ac[ps[i][0]] = True

print(str(ac.count(True)) + " " + str(sum(wa)))


### FIXED CODE ###

n, m = list(map(int, input().split()))
ps = []
for i in range(m):
    tmp = input().split()
    ps.append([int(tmp[0]), tmp[1]])

ac = [False] * (n + 1)
wa = [0] * (n + 1)
for i in range(m):
    if not ac[ps[i][0]]:
        if ps[i][1] == "WA":
            wa[ps[i][0]] += 1
        elif ps[i][1] == "AC":
            ac[ps[i][0]] = True
wa_sum = 0
for i in range(n + 1):
    if ac[i]:
        wa_sum += wa[i]
print(str(ac.count(True)) + " " + str(wa_sum))
S = input()

if  0 < int(S[0:2]) <=12  and 0 < (int(S[2:4])) <= 12:
    print("AMBIGUOUS")
elif int(S[0:2]) > 12 and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12 and int(S[2:4]) > 12:
    print("MMYY")
elif int(S[0:2]) == and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12  and 0 < (int(S[2:4])) == 0:
    print("MMYY")
else:
    print("NA")

### FIXED CODE ###

S=input()
A=int(S[:2])
B=int(S[2:])
if 1<=A<=12:
    if 1<=B<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1<=B<=12:
        print("YYMM")
    else:
        print("NA")
import numpy as np
n = int(input())
a = list(map(int,input().split()))
a_n = np.array(a,dtype=np.float64)
#print(a_n)
result = np.prod(a_n)
if result > 10**18:
    print(-1)
else:
    print(int(result))

### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int,input(). split ()))
    if 0 in A:
        print(0)
        return
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
    print(prod)
    
main()
a,b,c,d=map(int,inputa().split())
print(max(a*b,c*d))

### FIXED CODE ###

A,B,C,D=map(int,input().split())
sone=A*B
stwo=C*D
if sone>stwo:
    print(sone)
elif sone<stwo:
    print(stwo)
elif sone==stwo:
    print(sone)
n = int(raw_input())
k[0] = 0;

for i in range(n-1);
  k[i] = int(raw_input())
  if(k[0]<=k[i]);
    max = k[i]
  elif(k[0]>=k[i]);
    min = k[i]
print max,min

### FIXED CODE ###

n = raw_input()
x = map(int, raw_input().split())
print ("%d %d %d") %(min(x), max(x), sum(x))
x = [int(input()) for i in range(5)]
a = []
res = 0
for i in x:
    if i%10!=0:
        a.append(10-i%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)

### FIXED CODE ###

x = [int(input()) for i in range(5)]
a = [0]
res = 0
for i in range(5):
    if x[i]%10!=0:
        a.append(10-x[i]%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)
n = int(input())
strings = input()
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

new_strings = ''
for s in strings:
    index = letters.index(s)
    added_index = index + n
    new_index = added_index % 26
    new_s = letters[new_index]
    new_strings += new_s

print(new_strings)

### FIXED CODE ###

n = int(input())
strings = input()
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

new_strings = ''
for s in strings:
    index = letters.index(s)
    added_index = index + n
    new_index = added_index % 26
    new_s = letters[new_index]
    new_strings += new_s

print(new_strings)
N = int(input())
S = input()
 
ansAC = 0
ansWA = 0
ansTLE = 0
ansRE = 0
 
for i in range(N):
  if i == "AC":
    ansAC += 1
  elif i == "TLE":
    ansTLE += 1
  elif i == "WA":
    ansWA += 1
  elif i == "RE":
    ansRE += 1
print("AC x " + ansAC)
print("WA x " + ansWA)
print("TLE x " + ansTLE)
print("RE x " + ansRE)

### FIXED CODE ###

N = int(input())
ansAC = 0
ansWA = 0
ansTLE = 0
ansRE = 0
 
for i in range(N):
  S = input()
  if S == "AC":
    ansAC += 1
  elif S == "TLE":
    ansTLE += 1
  elif S == "WA":
    ansWA += 1
  elif S == "RE":
    ansRE += 1
print("AC x " + str(ansAC))
print("WA x " + str(ansWA))
print("TLE x " + str(ansTLE))
print("RE x " + str(ansRE))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
m = map(int,read().split())
AB = zip(m,m)
 
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
 
dist = [-1] * (N+1)
stack = [1]
dist[1] = 0
while stack:
    v = stack.pop()
    for w in graph[v]:
        if dist[w] == -1:
            dist[w] = dist[v] + 1
            stack.append(w)
 
ev = [i for i,x in enumerate(dist) if x % 2 == 0 and i > 0]
od = [i for i,x in enumerate(dist) if x % 2 == 1 and i > 0]
 
def make_perm(N, ev, od, x0, x1, x2, y0, y1, y2):
    assert len(ev) == x0 + x1 + x2
    assert len(od) == y0 + y1 + y2
    P = [0] * (N+1)
    for i in ev:
        if x0:
            P[i] = (x0 + y0) * 3
            x0 -= 1
            continue
        if x1:
            P[i] = (x1 + y1) * 3 - 2
            x1 -= 1
            continue
        if x2:
            P[i] = (x2 + y2) * 3 - 1
            x2 -= 1
            continue
    for i in od:
        if y0:
            P[i] = (x0 + y0) * 3
            y0 -= 1
            continue
        if y1:
            P[i] = (x1 + y1) * 3 - 2
            y1 -= 1
            continue
        if y2:
            P[i] = (x2 + y2) * 3 - 1
            y2 -= 1
            continue
    return P[1:]
 
def solve(N, ev, od):
    x0 = N // 3
    x1 = (N+2) // 3
    x2 = (N+1) // 3
    perm = [0] * (N+1)
    LE = len(ev)
    LO = len(od)
    if LE <= x0:
        return make_perm(N, ev, od, LE, 0, 0, x0-LE, x1, x2)
    if LO <= x0:
        return make_perm(N, ev, od, x0-LO, x1, x2, LO, 0, 0)
    if LE == x1:
        return make_perm(N, ev, od, 0, x1, 0, x0, 0, x2)
    if LO == x1:
        return make_perm(N, ev, od, x0, 0, x2, 0, x1, 0)
    # どちらも x1 よりたくさんある
    return make_perm(N, ev, od, LE-x1, x1, 0, LO-x2, 0, x2)
 
P = solve(N, ev, od)
print(' '.join(map(str, P)))


### FIXED CODE ###

data =["hi","hihi","hihihi","hihihihi","hihihihihi"]
line = input()
if line in data:
  print("Yes")
else:
  print("No")
import math
import fractions
from functools import reduce

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

mod = 10**9+7

def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)
# ax ≡ 1 (mod m)
def modinv(a, m):
    (inv, q, gcd_val) = egcd(a, m)
    return inv % m

def lcm(x, y):
    tmp = modinv(math.gcd(x,y),mod)
    return (x * y) * tmp

l = 1
for k in a:
    l = lcm(l,k)

l = l % mod

mod = 10**9+7
res = 0
for k in a:
    tmp = modinv(k, mod)
    res = (res + l * tmp % mod) % mod

res = res % mod
print(res)

### FIXED CODE ###

from fractions import gcd

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

l = a[0]
for k in a:
  l = ( l * k ) // gcd(l, k)

mod = 10 ** 9 + 7
ans = 0
for k in a:
  ans += l // k

print( int(ans) % mod )
import numpy as np
n=int(input())
y=list(map(int,input().split()))
y=list(map(lambda x: x*2,y))
A=np.zeros((n,n),dtype='int')
for i in range(n-1):
  for j in range(i,i+2):
    A[i][j]=1
A[n-1][0],A[n-1][n-1]=1,1
b=list(map(int,np.linalg.solve(A,y)))
print(*b)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=[sum(a)-2*sum(a[1:n-1:2])]
for i in range(1,n):
  b.append(2*a[i-1]-b[-1])
print(*b)
N,M=map(int,input().split())
A=[]*N
for i in ragne(N):
  A[i]=list(map(int,input().split()))

### FIXED CODE ###

N,M=map(int,input().split())
KA=[0]*N
count=[0]*(M+1)
for i in range(N):
  KA[i]=list(map(int,input().split()))
for i in range(N):
  for j in range(1,len(KA[i])):
    count[KA[i][j]]+=1
ans=0
for i in range(1,M+1):
  if count[i]==N :
    ans+=1
print(ans)
import re
S = input()
print(max([len(s) for s in re.findall('[ACGT]+',S)]))

### FIXED CODE ###

import re
S = input()
ACGT = re.findall('[ACGT]+',S)
if len(ACGT) > 0:
    print(max([len(s) for s in ACGT]))
else:
    print(0)
S = input()
s = set(S)

print('Yes' if len(s)==2 and S.count(s[0]) == S.count(s[1]) == 2 else 'No')

### FIXED CODE ###

S = input()
s = list(set(S))

print('Yes' if len(s)==2 and S.count(s[0]) == S.count(s[1]) == 2 else 'No')
n=int(input())
flag=0
for i in range(n):
    d1,d2=map(int,input().split())
    if d1==d2:
        flag+=1
        if flag==3:
            ans=1
    else:
        flag=0
if ans!=1:
    print("No")
else:
    print("Yes")
    

### FIXED CODE ###

n=int(input())
flag=0
ans=0

for i in range(n):
    d1,d2=map(int,input().split())
    if d1==d2:
        flag+=1
        if flag==3:
            ans=1
    else:
        flag=0
if ans!=1:
    print("No")
else:
    print("Yes")
n = int(input())
search = list(map(int,input().split()))
search.sort()
dp = [1]*(search[-1]+1)
if search[0] == 1:
    if search[1] != 1:
        print(1)
    else:
        print(0)
else:
    for i in search:
        k = 2*i
        while k <= search[-1]:
            if dp[k]:
                dp[k] = 0
                k += i
            else:
                break
    ans = 0
    flag = False
    j = -1
    for i in search:
        if flag:
            if i != j:
                flag = False
                ans -= dp[j]
        else:
            if i == j:
                flag = True
            else:
                ans += dp[i]
                j = i
    
print(ans-dp[search[-1]] if flag else ans)

### FIXED CODE ###

n = int(input())
search = list(map(int,input().split()))
search.sort()
double = set([])
for i in range(n-1):
    if search[i+1] == search[i]:
        double.add(search[i])
dp = [1]*(search[-1]+1)
for i in search:
    if not dp[i]:
        continue
    if i in double:
        dp[i] = 0
    k = 2*i
    while k <= search[-1]:
        dp[k] = 0
        k += i
print(sum((dp[i] for i in search)))
from itertools import product

n = int(input())
def calc(i):
    xs = [a for a in range(1,int(i**0.5))]
    ys = [a for a in range(1,int(i**0.5))]
    zs = [a for a in range(1,int(i**0.5))]
    cnt = 0
    for x,y,z in list(product(xs,ys,zs)):
        if x**2+y**2+z**2+x*y+y*z+z*x == i:
            cnt += 1
    print(cnt)






for i in range(1, n+1):
    calc(i)

### FIXED CODE ###

a, b, c = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    if i % c == 0:
        cnt += 1
print(cnt)
import sys
def main():
    tmp = sys.stdin.readline()
    while tmp:
        tmp = sys.stdin.readline().split("")
        a = 1
        b = 2
        if a > b:
            c = a
            d = b
        else:
            c = b
            d = a

        

        tmp = sys.stdin.readline()
        break

        
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

#最大公約数
def gcd(x, y):
    s = x / y
    r = x % y
    if r == 0:
        return y
    else:
        return gcd(y, r)

#最小公倍数
def lcm(x, y):
    return x*y/gcd(x, y)

def main():
    #print ("a")
    for line in iter(sys.stdin.readline, ""):
        #print (line)
        #tmp = sys.stdin.readline().split(" ")
        #print ("b")
        tmp = line.split(" ")
    
        a = int(tmp[0])
        b = int(tmp[1])
        #print ("a="+str(a))
        #print ("b="+str(b))
        #b = sys.stdin.readline()
        #print ("d")
        if a > b:
            c = a
            d = b
        else:
            c = b
            d = a

        print (str(gcd(c, d)) + " " + str(int(lcm(c,d))))

        #tmp = sys.stdin.readline()
        #if len(tmp) == 1:
        #    break
        #else:
        #    tmp = tmp.split(" ")

    #print ("exit")
     
if __name__ == "__main__":
    main()
S = input()
N = len(S)
ans = 'Yes'

for i in range(N):
    if S[2*i] == 'R':
        ans = 'No'
        break
    elif S[2*i+1] == 'L':
        ans ='No'
        break

print(ans)



### FIXED CODE ###

S = input()
N = len(S)
ans = 'Yes'

for i in range(N):   
    if S[i] == 'R' and (i+1)%2 == 0:
        ans = 'No'
        break
    elif S[i] == 'L' and (i+1)%2 == 1:
        ans ='No'
        break

print(ans)
s = input()
int(m) = s / 60
int(h) = s / 3600
return h, m, s

### FIXED CODE ###

n = input()
s = n % 60
m =((n % 3600) - s) / 60
h = n / 3600
print '%d:%d:%d' % (h, m, s)
T = input()

if T[0] == '?':
    T[0] = 'D'

for i, v in enumerate(T):
    if v == '?':
        if T[i - 1] == 'D':
            print('P', end='')
        else:
            print('D', end='')
    else:
        print(v, end='')

print('\n')

### FIXED CODE ###

T = input()

for i, v in enumerate(T):
    if v == '?':
        print('D', end='')
    else:
        print(v, end='')
print('\n')
n=input()
for i in range(0,n):
????????num=map(int, raw_input().split())
????????num.sort()
????????a=num[0]
????????b=num[1]
????????c=num[2]
????????if c*c==a*a+b*b:
????????????????print ("YES")
????????else:
????????????????print ("NO")

### FIXED CODE ###

import sys
for i in sys.stdin:
    try:
        sidelen = [int(j) for j in i.split(" ")]
        sidelen.sort(reverse=True)
        if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):
            print("YES")
        else:
            print("NO")
    except:
        continue