peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = input()
 
print("No" if "L" in N[::2] or "R" in N[1::2] else "Yes")
# Judge status: Accepted
import numpy as np
import sys


def main():
    input = sys.stdin.readline
    n, W = map(int, input().split())
    w, v = [0] * n, [0] * n
    for i in range(n):
        w[i], v[i] = map(int, input().split())
    ndp = np.zeros(W + 1, dtype=np.int64)
    for w, v in zip(w, v):
        np.maximum(ndp[:-w] + v, ndp[w:], out=ndp[w:])
    print(ndp[-1])


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = input()
N = s.count('N')
S = s.count('S')
E = s.count('E')
W = s.count('W')
if (N >= 1 and S >= 1) or (E >= 1 and W >= 1):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N, K, Q = map(int, input().split())
a_list = [int(input()) for _ in range(Q)]

point = [0] * N
for a in a_list:
    point[a-1] += 1

for i in point:
    if K - (Q - i) <= 0:
        print('No')
    else:
        print('Yes')
# Judge status: Accepted
N,K = map(int, input().split())
 
counter = 1
tmp = 1
while True:
    tmp *= K
    if tmp > N:
        break
    counter += 1
print(counter)
# Judge status: Wrong Answer
N, K = map(int, input().split())


if N == 0:
    print(N)
elif K == 0:
    print(K)
elif N < K:
    k = K % N
    ans = abs(N - k)
    print(ans)
elif N > K:
    k = N % K
    ans = abs(K - k)
    if k == 0:
        print("0")
    else:
        print(ans)
else:
    print("0")
# Judge status: Wrong Answer
s = input()
ss = list(set(s))
N = len(ss)

cnt = 0
for i in range(N):
    cnt=cnt+s.count(ss[i])
    
if cnt%2==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
in_num = int(input())
check_num = 0
ans_counter = 0



while check_num <= in_num:
	i = 1
	div_counter = 0
	while i <= check_num :
		if check_num % i == 0:
			div_counter += 1
		i += 2
	if div_counter == 8:
		ans_counter += 1
	check_num += 2

print(ans_counter)
# Judge status: Accepted
a,b,c=map(int,input('').split())
k=int(input())
for i in range(k):
    if a<b and b<c:
        print("Yes")
        exit()
    if b<=a:
        b*=2
        continue
    if c<=b:
        c*=2
        continue
if a<b and b<c:
    print("Yes")
else:
    print('No')
# Judge status: Wrong Answer
n, x = map(int, input().split())
L = list(map(int, input().split()))

ans = 1
sum_L = 0
for j in range(n):
    sum_L += sum_L + L[j]
    if sum_L <= x :
        ans += 1
    else :
        exit(0)
        print(ans)
# Judge status: Accepted
import copy
N=int(input())
p=[int(i) for i in input().rstrip().split()]
p_c=copy.deepcopy(p)
p_c.sort()

cnt=0
for i in range(len(p)):
  if p[i]!=p_c[i]:
    cnt+=1
  else:
    continue


if cnt==2 or cnt==0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)

A, B = list(map(int, input().split()))
print(lcm(A,B))
# Judge status: Accepted
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  k = input().upper()
  if k == 'AC':
    ac +=1
  elif k == 'WA':
    wa +=1
  elif k == 'TLE':
    tle +=1
  elif k == 'RE':
    re +=1
    
print('{} x {}'.format('AC',ac))
print('{} x {}'.format('WA',wa))
print('{} x {}'.format('TLE',tle))
print('{} x {}'.format('RE',re))
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

o = input().strip()
e = input().strip()

ans = []
for i, v in enumerate(o):
    ans.append(v)
    if (i != len(o) - 1) or (len(o) == len(e)):
        ans.append(e[i])
print(''.join(ans))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
s = sum(A)
e = 1

ans = 1
flag = 1

if N == 0:
    if s >= 2:
        flag = 0
    else:
        ans = 1
else:
    for i in range(N):
        e = (e - A[i]) * 2
        if e < A[i+1]:
            flag = 0
            break
        tmp = min(e, s)
        s -= A[i+1]
        ans += tmp
if flag == 0:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort()
ans = 0
for i in range(k):
    ans += l[i]

print(ans)
# Judge status: Accepted
N, K = map(int,input().split())
H = list(map(int,input().split()))
         
H.sort(reverse=True)

print(sum(H[K:]))
# Judge status: Accepted
import bisect

n = int(input())
seq = []
for i in range(n):
    seq.append(int(input()))
seq.reverse()
LIS = [seq[0]]
for i in range(1,len(seq)):
    if seq[i] >= LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect.bisect_right(LIS, seq[i])] = seq[i]

print(len(LIS))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
from bisect import bisect_left
 
 
n, m = map(int, input().split())
a = list( map(int, input().split()))
a.sort()
 
bc = [tuple(map(int,input().split())) for i in range(m)]
bc = sorted(bc, reverse=True, key=lambda x: x[1])
 
i = 0
d = []
for b, c in bc:
    d.extend([c]*b)
    if len(d) >= n:
        break
 
a=a+d
a.sort(reverse=True)
print(sum(a[:n]))

#l.sort(reverse=True)
#A=A+l[:N]
#A.sort(reverse=True)
# Judge status: Accepted
K = int(input())

import fractions

A = {}
sum = 0

for i in range(K):
    for j in range(K):
        if fractions.gcd(i+1,j+1) in A:
            A[fractions.gcd(i+1,j+1)] += 1
        else:
            A[fractions.gcd(i+1,j+1)] = 1

for key in A:
    for i in range(K):
        sum += fractions.gcd(key,i+1)*A[key]

print(sum)
# Judge status: Accepted
N,K=map(int,input().split())
S=list(input())
ans=0
lr=0
rl=0
for i in range(N-1):
    if S[i]=="L":
        if S[i+1]=="R":
            lr=lr+1
        else:
            ans=ans+1
    else:
        if S[i+1]=="L":
            rl=rl+1
        else:
            ans=ans+1
change=max(rl,lr)
ans=ans+2*min(change,K)
print(min(ans,N-1))
# Judge status: Accepted
X = int(input())
y = X // 500
X = X % 500
y = 1000 * y + (X // 5) * 5
print(y)
# Judge status: Accepted
from numba import njit


@njit(cache=True)
def solve(n,x,y):
    ans = [0] * (n - 1)
    for i in range(n):
        for j in range(n):
            c = min(abs(i - j), abs(i-x)+abs(j-y)+1,abs(i-y)+abs(j-x)+1)
            if c:
                ans[c-1] += 1
    return ans


n, x, y = map(int, input().split())
x -= 1
y -= 1
ans = solve(n,x,y)
for ai in ans:
    print(ai//2)
# Judge status: Accepted
n = int(input())
b = list(map(int, input().split()))

ans = b[0] + b[n - 2]
for i in range(1, n - 1):
    ans += min(b[i], b[i - 1])
print(ans)
# Judge status: Accepted
x = list(map(int,list(input())))
n = len(x)
dp = [[0,1] for _ in range(n+1)]
for i in range(n):
    dp[i+1][0] = min(dp[i][0]+x[i],dp[i][1]+10-x[i])
    dp[i+1][1] = min(dp[i][0]+x[i]+1,dp[i][1]+9-x[i])
print(dp[n][0])
# Judge status: Wrong Answer
N = str(input())

N1 = set(N)

if (len(N1) < 3) and N[1] == N[2]:
  print("Yes")
  
else:
  print("No")
# Judge status: Wrong Answer
a, b = (int(x) for x in input().split())
s = (a + b) % 2
t = (a + b) / 2
if s == 0:
	print(t)
else:
	print(t + 0.5)
# Judge status: Accepted
from collections import Counter as C

_ = input()
a = C([int(x) for x in input().split()])

b = [0, 0]
for k, v in a.items():
    b.extend([k] * (v // 2))
else:
    b.sort()
    print(b[-1] * b[-2])
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
kisuu = 0
guusuu = 0
baisuu_4 = 0

for num in a:
  if num%2 == 1:
    kisuu += 1
  elif num%4 == 2:
    guusuu += 2
  else:
    baisuu_4 += 1

if guusuu ==0:
  if baisuu_4 >= kisuu - 1:
    print('Yes')
  else:
    print('No')
else:
  if baisuu_4 >= kisuu:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
s=list(input())
s.sort()

if s[0]=="a" and s[1]=="b" and s[2]=="c":
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
P = 2
Q = 3
R = 4

list1 = [P+Q, P+R, Q+P, Q+R, R+P, R+Q]
print(min(list1))
# Judge status: Accepted
n=int(input())
if n%2==0:
    print(0.5)
else:
    print((n//2+1)/n)
# Judge status: Accepted
s=input()
if s.count("a")==1 and s.count("b")==1 and s.count("c")==1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
N = N % 10
if N == 3:
  print("bon")
elif N == 0 or N == 1 or N == 6 or N == 8:
  print("pon")
else:
  print("hon")
# Judge status: Wrong Answer
n,m=map(int,input().split())
lst=[[] for i in range(n)]
visited=[True]+[False]*(n-1)
ans=[0]*n

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

Q=[0]

while Q:
  v=Q.pop(0)
  for i in lst[v]:
        if visited[i]==False:
              visited[i]=True
              ans[i]=v
              Q.append(v)

print('Yes')

for i in range(1,n):
      print(ans[i])
# Judge status: Accepted
X = int( input() )
 
A = 0
B = 0
for i in range(-900, 900):
  for j in range( -900, 900 ):
    if i**5 - j ** 5 == X:
      A = i
      B = j
print( A, B )
# Judge status: Accepted
n = int(input())
s = input()

# 左側の黒の個数, 右側の白の個数
b, w = 0, s.count('.')
ans = min(s.count('#'), w)
for i in range(n):
    if s[i] == '#':
        b += 1
    elif s[i] == '.':
        w -= 1
    ans = min(ans, b+w)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]

ans = [-1 for _ in range(n)]
for sci in sc:
	if ans[sci[0]-1] == -1:
		ans[sci[0]-1] = sci[1]
	elif ans[sci[0]-1] != sci[1]:
		print(-1)
		exit(0)

if ans[0] == 0 and n != 1:
	print(-1)
	exit(0)

ansint = 0
for i, a in enumerate(ans):
	ansint *= 10
	if a == -1:
		if i == 0 and n != 1:
			ans[i] = 1
		else:
			ans[i] = 0
	ansint += ans[i]

print(ansint)
# Judge status: Accepted
a, b = list(map(int, input().split(' ')))
v = a * b
print("Even" if v % 2 == 0 else "Odd")
# Judge status: Wrong Answer
n= int(input())
lst = [int(i) for i in input().split()]
lst = sorted(lst)
count = 0
d_lst = []
for i in range(len(lst)-1):
    if lst[i] not in d_lst:
        if lst[i] == lst[i+1]:
            d_lst.append(lst[i])
for d in d_lst:
    count += d**2
lst = list(set(lst))

for i in range(len(lst)-1):
    for j in range(i+1,len(lst)):
        a = lst[i] * lst[j]
        count += a

if count > ( 10**9 + 7 ):
    print(count % (10**9 + 7))
else:
    print(count)
# Judge status: Accepted
n, d = map(int, input().split())
cnt = 0
for ti in range(n) :
  x, y = map(int, input().split())
  dist = (x**2 + y**2)**0.5
  if(dist <= d):
    cnt += 1
    
print(cnt)
# Judge status: Accepted
l = [int(input()) for i in range(5)]
L = []
for i in l:
  if i%10==0:
    L.append(0)
  else:
    L.append(10-i%10)
print(sum(l)+sum(L)-max(L))
# Judge status: Wrong Answer
n=int(input())

p=1

for i in range(1,n+1):
  p=p*i%(10^9+7)

print(p)
# Judge status: Accepted
a, b, c = map(int, input().split())

if a+b-c==0 or b+c-a==0 or c+a-b==0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N=int(input())
L=list(map(int,input().split()))
if N<=2:
  print(0)
else:
  ans=0
  for i in range(N-2):
    for j in range(i+1,N-1):
      for k in range(j+1,N):
        if L[i] !=L[j] and L[i]!=L[k] and L[j]!=L[k]:
          ma=max(L[i],L[j],L[k])
          mi=min(L[i],L[j],L[k])
          nu=L[i]+L[j]+L[k]-ma-mi
          if ma<mi+nu:
            ans+=1
  print(ans)
# Judge status: Accepted
x = list(map(int, input().split()))
imos = [0]*(max(x) + 2)
imos[x[0]] += 1
imos[x[1]+1] -= 1
imos[x[2]] += 1
imos[x[3]+1] -= 1
for i in range(len(imos)-1):
    imos[i+1] += imos[i]
print(max(imos.count(2) - 1, 0))
# Judge status: Accepted
import collections
N = int(input())
A = list(map(int,input().split()))
dic = collections.Counter(A)
def helper(n):
    return n*(n-1)//2
ans = 0
for i in dic.keys():
    ans += helper(dic[i])
for i in A:
    print(ans-dic[i]+1)
# Judge status: Accepted
n = int(input())
a = [int(i)//400 for i in input().split()]
s = set()
f = 0
for i in a:
    if i>=8:
        f += 1
    else:
        s.add(i)
mn = len(s)
if len(s)==0: mn += f>0
mx = len(s)+f
print(mn, mx)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
isOK = True
B = [0]*(N+1)
B[0] = 1-A[0]
M = 1
i = 1
while i <= N:
  B[i] = B[i-1]*2-A[i]
  i += 1
if B[-1] < 0 or N > 0 and A[-1] == 0:
  isOK = False
B[-1] = A[-1]
i = N-1
while i >= 0:
  if B[i] < 1 or i > 0 and B[i] > B[i-1]*2:
    isOK = False
    break
  else:
    B[i] = min(B[i], B[i+1])+A[i]
  i -= 1
print(-1 if not isOK else sum(B))
# Judge status: Wrong Answer
S=input()
print("Yes" if len(S)==3 else "No")
# Judge status: Wrong Answer
m, n = map(int, input().split())
while True:
  if m < n:
    m, n = n, m
  if m%n:
    m, n = n, m%n
  else:
    break
def divisors(m):
    divisors = [1]
    for i in range(2, int(m**0.5)+2):
        if m % i == 0:
            divisors.append(i)
        while m % i == 0:
            m //= i
        if m == 1:
            break
    return divisors

print(len(divisors(n)))
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    A -= 1
else:
    B -= 1

print(f'{A} {B}')
# Judge status: Wrong Answer
import numpy as np

MOD = 10 ** 9 + 7

n=int(input()) #3
alst=list(map(int,input().split())) #[1,2,3]

# 累積和を求める

# 例
# [1,2,3,4,5,6]の時、累積和は、
# [0,1,3,6,10,15,21]

s=[0]
s=list(np.cumsum(alst))

sum=0

for i in range(len(alst)-1):
  sum+=alst[i]*(s[len(s)-1]-s[i])

print(sum%MOD)
# Judge status: Accepted
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    k = int(input())
    S = input()
    if len(S) <= k:
        print(S)
    else:
        print(S[:k] + "...")
resolve()
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    a,b,c=map(int,readline().split())

    li=[a,b,c]
    li.sort()
    x=li[0]
    y=li[1]
    z=li[2]

    cnt=0
    cnt+=z-y
    x+=z-y
    y+=z-y
    if (z-x)%2==0:
        cnt+=(z-x)//2
    else:
        cnt+=(z-x+1)//2+1

    print(cnt)
if __name__=="__main__":
    main()
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())
while b <= a and k > 0:
    b *= 2
    k -= 1
while c <= b and k > 0:
    c *= 2
    k -= 1
if a < b < c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = input()
x = 753
ans = float('inf')
for i in range(len(S) - 2):
    y = int(S[i : i + 3])
    ans = min(ans, abs(x - y))
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
cards = sorted(list(map(int, input().split())))

changer = []
for i in range(m):
    p, c = map(int, input().split())
    changer.append((p, c))

changer.sort(key=lambda x: x[1])

cur = 0
while len(changer) and cur < n:
    p, c = changer.pop()
    i = cur
    while i < n and i < cur + p:
        if cards[i] < c: cards[i] = c
        else: break
        i += 1
    cur = i
print(sum(cards))
# Judge status: Wrong Answer
import numpy as np
A,B,H,M = (int(x) for x in input().split())
argA = 30*H + 0.5*M
argB = 6*M
if argA>argB:
    arg = argA-argB
else:
    arg = argB-argA
    
if arg > 180:
    arg -= 180
    
cc = A**2 + B**2 -2*A*B*np.cos((arg/180)*np.pi)
c = np.sqrt(cc)

print(c)
# Judge status: Wrong Answer
import itertools
C = []
s = 0
for _ in range(3):
    c = list(map(int, input().split()))
    s += sum(c)
    C.append(c)
    
if s % 3 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import statistics
n=int(input())
alist=list(map(int, input().split()))
blist=[]
for i in range(n):
  blist.append(alist[i]-i-1)
blist.sort()
median=statistics.median_high(blist)
ans=0
for i in range(n):
  ans+=abs(blist[i]-median)
print(ans)
# Judge status: Wrong Answer
MOD = 10**9 + 7


def fact(n, MOD):
    res = 1
    for i in range(1, n + 1):
        res *= i
        res %= MOD
    return res


N, M = map(int, input().split())
ans = 1

if abs(N - M) < 2:
    ans *= fact(N, MOD) * fact(M, MOD) % MOD
    if N == M:
        ans *= 2
        ans %= MOD
print(ans)
# Judge status: Accepted
W,H,N=map(int,input().split())
x_right=W
x_left=0
y_ceil=H
y_floor=0
for i in range(N):
    x,y,a=map(int,input().split())
    if a==1:
        x_left=max(x,x_left)
    elif a==2:
        x_right=min(x,x_right)
    elif a==3:
        y_floor=max(y,y_floor)
    else:
        y_ceil=min(y,y_ceil)
ans=(x_right-x_left)*(y_ceil-y_floor)
if x_left>=x_right or y_ceil<=y_floor:
    ans=0
print(ans)
# Judge status: Accepted
k = int(input())
print((k // 2) ** 2) if k % 2 == 0 else print(((k // 2) + 1) * (k // 2))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
count = 0
while True:
    for i in range(n):
        if a[i]%2 == 0:
            a[i] = a[i]//2
        else:
            print(count)
            exit()
    count += 1
print(count)
# Judge status: Accepted
n = int(input())
a = list()
for _ in range(n):
    a.append(int(input())-1)
g = 0
cnt = 1
while cnt <= n:
    g = a[g]
    if g == 1:
        print(cnt)
        exit()
    cnt += 1
print(-1)
# Judge status: Wrong Answer
a, b=map(int,input().split())
if (a < 0 and 0 < b) or (a == 0 or b ==0):
  print("Zero")
  exit()
elif 0 < a:
  print("Positive")
  exit()

m = abs(a)
if m % 2 == 0:
  print("Positive")
else:
  print("Negative")
# Judge status: Accepted
K, S = map(int, input().split())
count = 0
for i in range(K + 1):
    for j in range(K + 1):
        if 0 <= S - i - j <= K:
            count += 1
print(count)
# Judge status: Wrong Answer
n,m=map(int,input().split())

print(n*(n-1)/2+m*(m-1)/2)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
b = 0
for x in A:
    b ^= x
for i in range(len(A)):
    A[i] ^= b
print(*A)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

flag = 0
 
ans = 1
for i in range(n - 1):
  if flag == 1:
    if a[i] > a[i + 1]:
      ans += 1
      flag = 0
  elif flag == -1:
    if a[i] < a[i + 1]:
      ans += 1
      flag = 0
  else:
    if a[i] > a[i + 1]:
      flag = -1
    elif a[i] < a[i + 1]:
      flag = 1
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=sum(a)-a[0]
y=sum(b)-b[n-1]
ans=a[0]
flag=0
for i in range(n-1):
  if x>y:
    ans+=a[i+1]
    x-=a[i+1]
    y-=b[i]
  else:
    ans+=y
    break

print(ans+b[n-1])
# Judge status: Wrong Answer
s = input()
if (s[0]==s[1] and s[1]==s[2]) and (s[1]==s[2] and s[2]==s[3]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b = [int(x) for x in input().split()]
print(sum([1 for i in range(a, b + 1) if i == int(str(i)[::-1])]))
# Judge status: Wrong Answer
sa = input()
sb = input()
sc = input()

S = [sa, sb, sc]
d = {'a':0, 'b':1, 'c':2}

sidx = [0, 0, 0]
# 次の人
nxt = S[0][0]
sidx[d[nxt]] += 1
while True:
    try:
        nxt = S[d[nxt]][sidx[d[nxt]]]
        sidx[d[nxt]] += 1
    except:
        print(nxt.upper())
        break
# Judge status: Wrong Answer
k,a,b = map(int,input().split())
dif = b-a
if b<=2:
  print(k+1)
else:
  ans = a
  k -= (a-1)
  ans += dif*(k//2)
  ans += (k%2==1)
  print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
hey=N
ans=1
while hey >= K:
    ans += 1
    hey = hey//K
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=list(input())

s[k-1]=s[k-1].lower()
print(s)
# Judge status: Wrong Answer
def check(A):
	for i in range(3):
		if A[0][i] == 0 and A[1][i] == 0 and A[2][i] == 0:
			return 1
		elif A[i][0] == 0 and A[i][1] == 0 and A[i][2] == 0:
			return 1
		elif A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0:
			return 1
	return 0
			


A = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for i in range(3):
	for j in range(3):
		if A[i][j] in b:
			A[i][j] = 0

if check(A):
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
A, B = map(int, input().split())

print(A*B)
# Judge status: Wrong Answer
N = int(input())

if N >= 189:
  print(3)
elif N >= 135:
  print(2)
elif N >= 105:
  print(1)
else:
  print(0)
# Judge status: Accepted
n = int(input())

d = []

x = 2
while n > 1 and x <= 1000000:
    t = 0
    while n % x == 0:
        t += 1
        n //= x
    if t > 0:
        d.append(t)
    x += 1
if n > 1:
    d.append(1)

def f(t):
    l, r = 0, t + 3
    while r - l > 1:
        c = (r + l) // 2
        if c * (c + 1) // 2 > t:
            r = c
        else:
            l = c
    return l
print(sum(f(ti) for ti in d))
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1, N + 1):
    ans += i
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())


ans = 0

if n > m * 2:
    ans = m//2
else:
    ans = n + (m-n*2)//4

print(ans)
# Judge status: Accepted
n,m,k = map(int,input().split())
print('YES' if n <= k <= n+m else 'NO')
# Judge status: Accepted
X, Y = map(int, input().split())
print(X+Y//2)
# Judge status: Accepted
S = input()

if S == ('SUN'):
    print(7)
elif S == ('MON'):
    print(6)
elif S == ('TUE'):
    print(5)
elif S == ('WED'):
    print(4)
elif S == ('THU'):
    print(3)
elif S == ('FRI'):
    print(2)
elif S == ('SAT'):
    print(1)
else:
    print('入力に誤りがあります。SUN,MON,TUE,WED,THU,FRI,SATのいずれかを入力してください。')
# Judge status: Wrong Answer
N,K=map(int,input().split())
S=str(input())
print(S.replace(S[K-1],str.lower(S[K-1])))
# Judge status: Wrong Answer
n,k = map(int, input().split())
L = [list(map(int, input().split())) for i in range(2*k)]
A = []
for i in range(k-1):
  A = A + L[2*i + 1]
ans = 0
for i in range(n):
  if i+1 not in A:
    ans += 1
    
print(ans)
# Judge status: Accepted
import math

x = int(input())
money = 100
year = 0

while money < x:
  money = math.floor(money*1.01)
  year += 1
print(year)
# Judge status: Accepted
N = int(input())
B = list(map(int,input().split()))
A = [0]*N

A[0] = B[0]
A[N-1] = B[N-2]

for i in range(N-2):
  if B[i] <= B[i+1]:
    A[i+1] = B[i]
  else:
    A[i+1] = B[i+1]
    
print(sum(A))
# Judge status: Accepted
n = int(input())
a = [int(input()) for i in range(n)]
check = [0 for i in range(n)]
check[0] = 1
i = 0
cnt = 0
while True:
	cnt += 1
	x = a[i]
	if x-1 == 1:
		print (cnt)
		exit()
	if check[x-1] == 1:
		print(-1)
		exit()
	else:
		check[x-1] = 1
	i = x-1
# Judge status: Accepted
k, x = map(int, input().split())
if(k*500 >= x): print('Yes')
else: print('No')
# Judge status: Accepted
s = input()

str_max = ""
int_max = 0
str_temp = ""
int_temp = 0

for i in s:
    if i == "A"or i == "C"or i == "G"or i == "T":
        str_temp += i
        int_temp += 1
        # print("OK", i)
    else:
        str_temp = ""
        int_temp = 0
        # print("NG", i)

    if int_max < int_temp:
        int_max = int_temp
        str_max = str_temp

print(int_max)
# Judge status: Accepted
n, m = map(int, input().split())
x = list(map(int, input().split()))

x.sort()
d = []
for i in range(m-1):
    d.append(x[i+1] - x[i])

d.sort(reverse=True)
# print(d)

print(sum(d[n-1:]))
# Judge status: Accepted
N, M = map(int,input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
prev = [0] * N
to_list = [ [] for _ in range(N)]
for a,b in AB:
 to_list[a - 1].append(b - 1)
 to_list[b - 1].append(a - 1)
marked = {0}
que = [0]
for i in que:
   for j in to_list[i]:
       if j in marked: continue
       que.append(j)
       marked.add(j)
       prev[j] = i+1
print('Yes')
print(*prev[1:], sep='\n')
# Judge status: Accepted
import queue


def m():
    N, M = map(int, input().split())
    q = queue.PriorityQueue()
    A = list(map(int, input().split()))
    ans = []
    for a in A:
        q.put(-a)
    while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
    while not q.empty(): ans.append(q.get())
    return abs(sum(ans))


print(m())
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1,1,-1):
    if 2<=h[i-1]-h[i]:
        print("No")
        exit()
    elif 1==h[i-1]-h[i]:
        h[i-1]-=1
print("Yes")
# Judge status: Accepted
s = input()
K = int(input())

ans = ''
for i, c in enumerate(s):
    dif = ord('z') - ord(c) + 1
    dif %= 26
    if i == len(s) - 1:
        K %= 26
        if ord(c) + K > ord('z'):
            K -= 26
        ans += chr(ord(c) + K)
    elif dif <= K:
        ans += 'a'
        K -= dif
    else:
        ans += c
print(ans)
# Judge status: Accepted
n = int(input())
X = list(map(int, input().split()))
for p in range(101):
    sum = 0
    for x in X:
        sum += ((x - p)**2)
    if p == 0:
        ans = sum
    if ans > sum:
        ans = sum
print(ans)