peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from heapq import*
(n,m),*t=[map(int,s.split())for s in open(0)]
q=[0]*7**6
v=[[]for _ in q]
z=0
for a,b in t:v[a-1]+=[b]
for i in v[:m]:
  for j in i:heappush(q,-j)
  z-=heappop(q)
print(z)
# Judge status: Accepted
i=int(input())
s=[]
s.append(i)
for i in range(1000000):
    if s[i]%2==0:
        if s[i]//2 in s:
            print(i+2)
            exit(0)
        else:
            s.append(s[i]//2)
    else:
        if 3*s[i]+1 in s:
            print(i+2)
            exit(0)
        else:
            s.append(3*s[i]+1)
# Judge status: Accepted
s=input()
t=input()
res=len(t)
for i in range(len(s)-len(t)+1):
    tmp=0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            tmp+=1
    res=min(tmp,res)
print(res)
# Judge status: Accepted
A11, A12, A13 = map(int, input().split())
A21, A22, A23 = map(int, input().split())
A31, A32, A33 = map(int, input().split())
N = int(input())
b = [int(input()) for i in range(N)] 

Bingo = [[A11, A12, A13], [A21, A22, A23], [A31, A32, A33], \
         [A11, A21, A31], [A12, A22, A32], [A13, A23, A33], \
         [A11, A22, A33], [A13, A22, A31]]

for j in Bingo:
  if set(j).issubset(b):
    print('Yes')
    exit()

print('No')
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
second, first = sorted(A)[-2:]

ans = [second if a==first else first for a in A]
[print(a) for a in ans]
# Judge status: Wrong Answer
N = int(input())
S = input()
l = 0
r = 0
for i in range(N):
    if S[i]=='(':
        l += 1
    else:
        r += 1

print('('*max(0,r-l)+S+')'*max(0,l-r))
# Judge status: Accepted
# 2020/09/13
# AtCoder Beginner Contest 178 - B

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

# Calc
ans = max(a*c, a*d, b*c, b*d)

# Output
print(ans)
# Judge status: Wrong Answer
S = input()
K = int(input())
z = ord('z') + 1

res = ""
flg = False
for i,c in enumerate(S):
    if z - ord(c) <= K:
        res += 'a'
        K -= z-ord(c)
    else:
        res += chr(ord(c))

res = res[:-1] + chr((ord(res[-1])-ord('a') + K) % 26 + ord('a'))
print(res)
# Judge status: Wrong Answer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-26 12:46:01 +0900
# LastModified: 2020-07-26 13:06:37 +0900
#


import os
import sys
import numpy as np
# import pandas as pd


def main():
    n, m, k = map(int, input().split())

    for s in range(n+1):
        for t in range(m+1):
            if k == n*s-s*t+(m-s)*t:
                print("Yes")
                return
    print("No")



if __name__ == "__main__":
    main()
# Judge status: Accepted
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
b = np.abs(A)
if np.count_nonzero(A < 0) % 2 == 0:
    print(np.sum(b))
else:
    print(np.sum(b)-np.min(b)*2)
# Judge status: Accepted
N=int(input())
print('ABC' if N<=999 else'ABD')
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
arai = sum(a)
sunu = 0
ans = 10**20
for i in range(N-1):
    arai -= a[i]
    sunu += a[i]
    ans = min(ans, abs(arai-sunu))
print(ans)
# Judge status: Wrong Answer
n = int(input())
n1 = n%10
n2 = (n-n1)%100
n3 = n//100

if (n1 == 7 or n2 == 7 or n3 == 7):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
K, X = map(int, input().split())
print(' '.join(map(str, range(X-K+1, X+K))))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=set()
b=0
for a in A:
    if a>=3200:
        b+=1
    else:
        B.add(a//400)
print(max(1,len(B)),len(B)+b)
# Judge status: Wrong Answer
N = int(input())

if (N%2 == 1):
    print(0)
elif N == 0:
    print(1)
else:
    N /= 2
    cnt = 1
    tmp_div_num = 0
    while True:
        # print(N)
        cnt += N // 5
        N /= 5
        if N < 5:
            break
    # print(N)
    print(int(cnt)-1)
# Judge status: Accepted
s = input()
t = input()
ans = 'No'
for i in range(len(s)):
    if s[i:]+s[:i] == t:
        ans = 'Yes'
print(ans)
# Judge status: Accepted
k=int(input())
sum=0
import math
for i in range(1,k+1):
    for j in range(1,k+1):
        s=math.gcd(i,j)
        for k in range(1,k+1):
            sum+=math.gcd(s,k)
        s=0
print(sum)
# Judge status: Accepted
N,D = map(int,input().split())
a = 0
for i in range(N):
  x,y = map(int,input().split())

  if (x*x+y*y)**0.5 <= D:
    a += 1
print(a)
# Judge status: Accepted
s=input()
for i in range(len(s)-2):
  s=s[:-1]
  if s[:len(s)//2]==s[len(s)//2:]:print(len(s));exit()
# Judge status: Accepted
s = input()
t = input()
ans = float("inf")
for i in range(len(s) - len(t) + 1):
    temp = 0
    for j in range(len(t)):
        if t[j] != s[i + j]:
            temp += 1
    ans = min(ans, temp)
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())

glaf = [[] for i in range(N)]

for i in range(M):
    a,b = map(int,input().split())
    a=a-1
    b=b-1
    glaf[a].append(b)
    glaf[b].append(a)
    
for i in glaf:
    cnt =0
    for j in i:
        cnt+=1
    
    print(cnt)
# Judge status: Accepted
import itertools
N, M, Q = map(int,input().split())
s = [tuple(map(int, input().split())) for i  in range(Q)]
l = list(range(1,M+1))
ans = []
for v in itertools.combinations_with_replacement(l, N):
    count = 0
    for i in range(Q):
        a, b, c, d = s[i]
        if v[b-1] - v[a-1] == c:
            count += d
    ans.append(count)
print(max(0, max(ans)))
# Judge status: Wrong Answer
import math

def digit(n):
    return len(str(n))

def digitsum(n):#nは正の整数、各位の和、許容は１０＾１０００
    if n<10:
        return n
    else:
        m=n//10
        return n%10+digit(m)

def maxdigit(N):
    if digit(N)==1:
        return N
    else:
        return max([9*(digit(N)-1)+int(str(N)[0])-1,digitsum(N)])

N=int(input())
print(maxdigit(N))
# Judge status: Accepted
X, N = map(int, input().split())
if N == 0:
  print(X)
  exit()
p = list(map(int, input().split()))
numlist = []

for i in range(102):
  if not i in p:
    numlist.append(i)
m = 500
for j in numlist:
  sa = abs(X-j)
  if sa < m:
    m = sa
    num = j

print(num)
# Judge status: Accepted
n = []
for i in range(5): n.append(int(input()))
k = int(input())

for i in range(5):
    for j in range(5):
        if n[i]-n[j] > k:
            print(':(')
            exit()

print("Yay!")
# Judge status: Wrong Answer
# 最大公約数
def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a

n,x = map(int,input().split())
X = list(map(int, input().split()))
X.sort()
dist = []
if len(X) == 1:
    print(X[0]-x)
    exit()
for i in range(len(X)-1):
    dist.append(X[i+1] - X[i])
ans = 0
for d in dist:
    ans = gcd(ans,d)
print(ans)
# Judge status: Accepted
N = int(input())
S = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in S:
    print(abc[(abc.index(i)+N)%len(abc)], end = "")
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  if str(i)==reversed(str(i)):
    c+=1
print(c)
# Judge status: Accepted
N,Y = map(int,input().split())
array = []
for i in range(N+1):
    for j in range(N+1-i):
        mon = 10000*i+5000*j+1000*(N-i-j)
        if mon == Y:
            print(i,j,N-i-j)
            exit()
print('-1 -1 -1')
# Judge status: Wrong Answer
whatMan = []

N, K = input().split()
print(input().split())
# Judge status: Accepted
#入力 人数N 入った順番A[i]
N = int(input())
A = list(map(int, input().split()))
#[入った順番 出席番号]のリストを作製
B = [[] for i in range(N)]
for i in range(N):
    B[i] = [A[i], i+1]
#入った順番(=最初の要素)早い順に並べる
B.sort()
#出席番号だけのリストを作製
ans = [0 for i in range(N)]
for i in range(N):
    ans[i] = B[i][1]
#リストの要素をスベース付きで全て表示
print(*ans)
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print(*a, **kw, file=sys.stderr)

N = ini()


def solve():
    k = 26
    a = k
    l = 1
    name = []
    x = N

    while x > 0:
        c = x % 26
        name.append(chr((c + 25) % 26 + ord("a")))
        x //= 26
    return "".join(reversed(name))


print(solve())
# Judge status: Wrong Answer
# coding: utf-8

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

n = 0

for i in range(N):
    
    _n = int(A*i/B) - A*int(i/B)
    if n < _n:
        n = _n

print(n)
# Judge status: Wrong Answer
x,y,z=map(int,input().split())

print(z,y,x)
# Judge status: Accepted
a,b = tuple(map(int,input().split()))

if b==1:
  print(0)
else:
  t = a
  ans = 1
  for i in range(20):
    if t>=b:
      print(ans)
      break
    ans+=1
    t += a-1
# Judge status: Accepted
import numpy as np

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

area = np.ones((W, H))

for _ in range(N):
    x, y, a = map(int, input().split())

    if a == 1:
        area[:x, :] = 0
    elif a == 2:
        area[x:, :] = 0
    elif a == 3:
        area[:, :y] = 0
    elif a == 4:
        area[:, y:] = 0

print(int(np.sum(area)))
# Judge status: Wrong Answer
line1 = input()
line2 = input()
ans = 0
for i in range(len(line1)):
  if line1[i] == line2[i]:
    ans += 1
print(ans)
# Judge status: Accepted
def solve():
    n = int(input())
    a = list(map(int, input().split()))

    ans = set()
    
    for i in range(n, 0, -1):
        now = 0
        for j in range(2*i, n+1, i):
            if j in ans:
                now += 1
        if now % 2 != a[i-1]:
            ans.add(i)
    
    return ans

if __name__ == '__main__':
    x = solve()
    print(len(x))
    print(*x, sep=' ')
# Judge status: Wrong Answer
import itertools
import bisect

n = int(input())

L = list(map(int,input().split()))

A = sorted(L)

ans = 0

for a,b in itertools.combinations(A,2):
    total = a + b
    ans += bisect.bisect_left(A,total) - bisect.bisect_right(A,max(a,b))

print(ans)
# Judge status: Accepted
N,S = open(0).read().split()
o = 0
c = 0
pre = 0
temp_o = 0
for b in S:
    if b == '(':
        o += 1
        temp_o += 1
    else:
        c += 1
        if temp_o == 0:
            pre += 1
        else:
            temp_o -= 1
suf = max(0,pre+o-c)
ans = ('('*pre) + S + (')'*suf)
print(ans)
# Judge status: Wrong Answer
n=int(input())
A=[1]*(n+1)
A[1]=1
for i in range(2,n+1):
    for j in range(i,n+1,i):
        A[j]+=1
A[1]=1
sum=0
for i in range(1,n+1):
    sum+=i*A[i]
print(sum)
# Judge status: Accepted
x=int(input())
l=[]
for i in range(1,1000+1):
    for k in range(2,11):
        z = i**k
        if z <= x:
            l.append(z)
print(max(l))
# Judge status: Accepted
input_line = input().split()

if int(input_line[0]) + int(input_line[1]) + int(input_line[2]) != 17:
    print("NO")
    pass
elif input_line[0] == input_line[1] == "5":
    print("YES")
    pass
elif input_line[1] == input_line[2] == "5":
    print("YES")
    pass
elif input_line[0] == input_line[2] == "5":
    print("YES")
    
else:
    print("NO")
# Judge status: Wrong Answer
N,K=map(int,input().split())
res={' '}
for i in range(K):
    d=input()
    ki=list(input())
    res|=set(ki)
res=[x for x in res if x!=' ']
print(N-len(res))
# Judge status: Accepted
n, m = map(int, input().split())
def zs(num):
    k = 6 - len(str(num))
    return '0' * k + str(num)
lst = []
for i in range(m):
  lst.append(tuple(map(int, input().split())))
slst = sorted(lst)
dic = {}
temp = 0
for i in range(m):
  if slst[i][0] == slst[i - 1][0]:
    temp += 1
  else:
    temp = 1
  dic[slst[i]] = zs(slst[i][0]) + zs(temp)
for i in lst:
  print(dic[i])
# Judge status: Accepted
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
b=1
for i in a:
  b=b//gcd(b,i)*i
ans=0
for i in a:
  ans+=(b//i)
print(ans%(10**9+7))
# Judge status: Wrong Answer
n, k = map(int, input().split())
al = list(map(int, input().split()))

if n <= k:
    print(1)
elif n <= k*2-1:
    print(2)
else:
    cnt = 0
    # m = n - (k-1)*2
    m = n
    while m >= 0:
        m = m - k + 1
        cnt += 1
    print(cnt-1)
# Judge status: Wrong Answer
a,b,n = map(int,input().split())
maxim=int(a*n/b)
print(maxim)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
b=True
for a in A:
    if a%2==0:
        if not (a%3==0 or a%5==0):
            b=False
print("APPROVED" if b else "DENIED")
# Judge status: Wrong Answer
n = int(input())
t,a = map(int,input().split())
hl = list (map(int,input().split()))

dt = 10**9
num = 0
for i in range(n):
  ti = t = hl[i]*0.006
  if abs(a - ti) <= dt:
    dt = abs(a -ti)
    num = i
    
    
print(num + 1)
# Judge status: Accepted
s = int(input())
dp = [0] * (s + 11)
mod = 10 ** 9 + 7
dp[0] = 1
dp[1] = 0
dp[2] = 0
dp[3] = 1
c = 2
for i in range(4, s + 1):
    dp[i] = (c - dp[i - 1] - dp[i - 2]) % mod
    c = (c + dp[i]) % mod
print(dp[s])
# Judge status: Wrong Answer
import math
h, n = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(n)]
A, B = map(list, zip(*AB))

memo = [0]*(h + 1)
for i in range(n):
    for j in range(h+1):
        if i == 0:
            memo[j] = math.ceil(j / A[i]) * B[i]
        elif j >= A[i]:
            memo[j] = min(memo[j], memo[j-A[i]]+B[i])
print(memo[-1])
# Judge status: Wrong Answer
n=int(input())
c=0
for i in range(1,n+1):
    if(i%2==0):
        x=i
        while(x%2==0):
            c+=1
            x//=2
print(c)
# Judge status: Wrong Answer
x, y = map(int, input().split())
num = 1
if x==y:
    print(-1)
    exit()
for i in range(x*y):
    if num % x == 0 and num % y != 0:
        print(num)
        break
    num += 1

print(num)
# Judge status: Accepted
from collections import deque

s = list(input())
q = int(input())
query = [list(input().split()) for i in range(q)]
now = 0
a = deque(s)
for i in query:
  if i[0] == "1":
    now ^= 1
  elif i[0] == "2":
    f,c = int(i[1]),i[2]
    if (f+now) % 2:
      a.appendleft(c)
    else:
      a.append(c)
if now:
  a.reverse()
ans = "".join(a)
print(ans)
# Judge status: Accepted
from math import *
from collections import Counter
def factorize(n):
	res = []
	while n%2 == 0:
		res.append(2)
		n = n//2
	for i in range(3,int(sqrt(n))+1,2):
		while n%i == 0:
			res.append(i)
			n = n//i
	if n > 2:
		res.append(n)

	return set(res)

n = int(input())
primes = factorize(n)
ans = 0
for i in primes:
	c = i
	while n%c == 0:
		n = n // c
		c = c * i
		ans+=1
print(ans)
# Judge status: Accepted
N=int(input())
count=0
if(N%2==1):
  print(0)
else:
  n=N//2
  i=1
  while(n//(5**i)>0):
    count+=n//(5**i)
    i+=1
  print(count)
# Judge status: Accepted
# ABC_129 C

def stairs(n, a):
    num_list = set(i for i in range(n+1) if i not in a)
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    if 1 not in a:
        dp[1] = 1
    for i in num_list:
        if i > 1:
            dp[i] = dp[i-1] + dp[i-2]
            
    result = dp[n] % 1000000007

    print(result)

    
n, m = list(map(int, input().split()))
a = set(int(input()) for _ in range(m))


if __name__ == '__main__':
    stairs(n, a)
# Judge status: Wrong Answer
C = str(input())
Z='abcdefghijklmnopqrtuvwxyz'
alpha = list(Z)
l_in = [alpha[i+1] for i in range(len(alpha)-1) if C in alpha[i]]
print(l_in)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

i = 1
j = 0

if not 1 in set(a):
    print(-1)

while i in a[j:]:
    j = a[j:].index(i) + j
    print(i, j)
    i += 1
    if j >= N:
        break
# Judge status: Accepted
from math import factorial
n,m=map(int,input().split())
l=10**9+7
if abs(n-m)>1:
  print(0)
  exit()
if abs(n-m)==1:
  print((factorial(n)*factorial(m))%l)
else:
  print(((factorial(n)**2)*2)%l)
# Judge status: Wrong Answer
def main():
    import sys
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n = ini()
    rick = 0
    for i in range(1,n+1):
        rick+=(n-1)/i
    print(rick)
        


    
        


        


    




















if __name__ == "__main__":
    main()
# Judge status: Accepted
x, k, d = map(int,input().split())
if x < 0: x = -x
mv = x // d
if mv >= k:
    # なるべく0に近づけば良い
    print(abs(x)-d*k)
else:
    nearest = x % d
    if (k - mv) % 2 == 1:
        print(abs(nearest - d))
    else:
        print(nearest)
# Judge status: Accepted
x,y = map(int, input().split())

z = y//x 

temp = 1
for i in range(10000):
    temp *= 2
    if z < temp:
        print(i+1)
        exit()
# Judge status: Accepted
N=int(input())
d=[[0]*10 for i in range(10)]
for i in range(1,N+1):
    n=str(i)
    d[int(n[0])][int(n[-1])]+=1
r=0
for i in range(9):
    for j in range(9):
        r+=d[i+1][j+1]*d[j+1][i+1]
print(r)
# Judge status: Accepted
a, b, k = map(int, input().split())

if b - a < k * 2:
    for i in range(a, b+1):
        print(i)

else:
    for i in range(a, a+k):
        print(i)
    for i in range(b-k+1, b+1):
        print(i)
# Judge status: Accepted
n = int(input())
m = 1
for i in range(1, n):
    if i ** 2 > n:
        break
    m = i ** 2
print(m)
# Judge status: Accepted
N, x = map(int,input().split())
a = list(map(int,input().split()))

ans=0
if a[0] > x:
    ans += a[0] - x
    a[0] = x

for i in range(1,N):
    if a[i] + a[i-1] > x:
        ans += a[i] - (x - a[i-1])
        a[i] = x - a[i-1]
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
if a+b+c >=22:
  print('bust')
else:
  print('win')
# Judge status: Accepted
_,_,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
f=0
for i in range(max(xl),min(yl)):
  if x<i<y:
    f=1
if f==1:
  print("No War")
else:
  print("War")
# Judge status: Accepted
N, M = map(int,input().split())
a = []
for i in range(M):
  K,S = map(int, input().split())
  a.append(K)
  a.append(S)
for i in range(N):
  print(a.count(i+1))
# Judge status: Wrong Answer
n=int(input())
s=input()
t=s.count('E')
ans=10**6
e=0
w=0
for i in range(n):
  if s[i]=='E':
    e+=1
    ans=min(ans,t-e+w-1)
  elif s[i]=='W':
    w+=1
    ans=min(ans,t-e+w-1)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
S = []
for _ in range(n):
	a, b = map(int, input().split())
	S.append([a, b])
P = []
for _ in range(m):
	c, d = map(int, input().split())
	P.append([c, d])
sorted(P)
for s in S:
	sx, sy = s[0], s[1]
	minv = float('inf')
	minvp = -1
	for i, p in enumerate(P):
		px, py = p[0], p[1]
		d = abs(px - sx) + abs(py - sy)
		if d < minv:
			minv = d
			minvp = i
	print(minvp + 1)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

ans = 0
for key,val in enumerate(A):
    ans += int(val/2)

    if key < N-1 and int(val/2)*2 != val and A[key+1] != 0:
        A[key+1] -= 1
        ans += 1
print(ans)
# Judge status: Accepted
r = int(input())
s = r*r
print(int(s))
# Judge status: Accepted
N, A, B = [int(x) for x in input().split()]

mod = int(N % (A + B))
kake = int(N // (A + B))
if mod <= A:
    print(kake*A + mod)
else:
    print(kake*A + A)
# Judge status: Accepted
n,m = map(int, input().split())
p = [0] * m
s = [0] * m
for i in range(m):
     p[i],s[i] = map(str,input().split())

lisa = [0] * n
lisw = [0] * n
for i in range(m):
     if lisa[int(p[i])-1] == 0:
          if s[i] == 'WA':
               lisw[int(p[i]) - 1] += 1
          else:
               lisa[int(p[i])-1] = 1
num = 0
for i in range(n):
     if lisa[i] == 1:
          num += lisw[i]



print(sum(lisa),num)
# Judge status: Accepted
def resolve():
    from collections import defaultdict
    N = int(input())
    A = [int(i) for i in input().split()]
    L = defaultdict(int)
    ans = 0
    for i in range(N):
        L[A[i] + i] += 1
        ans += L[i - A[i]]
    print(ans)


resolve()
# Judge status: Wrong Answer
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
d=min(a)+min(b)



for i in range(M):
    
    c=list(map(int,input().split()))
    
    h=a[c[0]-1]+b[c[1]-1]-c[2]
    f=h
    if f > h:
        f=h
        


if d>f:
    d=f
print(d)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

ans = 0
cnt = 0
for i in range(n-1):
    
    if h[i] >= h[i+1]: cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0

ans = max(ans, cnt)
print(ans)
# Judge status: Accepted
n=int(input())
a=int(input())

if n%500 >a:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if abs(b-a)<=(v-w)*t:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
W,a,b = map(int,input().split())
if a<=b<=a+W or a<=b+W<=a+W: print("0")
else: print(min(abs(a+W-b),abs(b+W-a)))
# Judge status: Accepted
S = input()
a = 0
if S == 'RSR':
    print(1)
else:
    for i in S:
        if i == 'R':
            a += 1
    print(a)
# Judge status: Wrong Answer
input = input().split()
m = int(input[0])
t = int(input[1])
s = int(input[2])

time = 0
if ( m % s == 0 ):
  time = m / s
else:
  time = (m / s) + 1

if time <= t:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import math
a,b=map(int,input().split())
print(math.ceil(b/a))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print("bust" if (a+b+c>21) else "Win")
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]

from collections import Counter

c = Counter(a)
print(sum([1 for num,cnt in c.items() if cnt%2==1]))
# Judge status: Wrong Answer
n, m = map(int, input().split())
s = sum(map(int, input().split()))
print(n-s)
# Judge status: Wrong Answer
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
import itertools
import math
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
start = time.time()
N = int(input())
A = list(map(int, input().split(' ')))
Asum = []
Adif = []
for i, j in enumerate(A):
    Asum.append(i-j)
    Adif.append(i+j)
ind = len(A)
Adif = ([0]*ind)+Adif
Asum = np.array(Asum)
Adif = np.array(Adif)

ans = 0
for i in range(1, ind):
    temp = (Asum == Adif[ind-i:2*ind-i])

    ans += temp.sum()

print(ans)
# Judge status: Accepted
ans = ["1","2","3"]
a,b = input(),input()
ans.remove(a)
ans.remove(b)
print(ans[0])
# Judge status: Wrong Answer
import math
n = int(input())
x = list(map(int, input().split()))
xx = sorted(x)
middle = (xx[n//2]+xx[n//2-1])/2
for i in x:
    if i < middle:
        print(math.ceil(middle))
    else:
        print(int(middle))
# Judge status: Wrong Answer
import sys

n, a, b, c, d = map(int, input().split())
a, b, c, d = a - 1, b - 1, c - 1, d - 1
s = input()

for i in range(a + 1, max(c, d) - 1):
    if s[i: i + 2] == '##':
        print('No')
        sys.exit()

if c < d:
    print('Yes')
    sys.exit()

for i in range(b, d):
        if s[i - 1: i + 2] == '...':
            print('Yes')
            sys.exit()

print('No')
# Judge status: Accepted
N,M=map(int,input().split())

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]
  
d = make_divisors(M)
d = list(filter(lambda x:x<=M/N,d))

print(d[-1])
# Judge status: Accepted
n=int(input())
print(800*n-int(n/15)*200)
# Judge status: Accepted
n=int(input())
ans=0
result=0
s=[]
for _ in range(n):
    s.append(int(input()))
    
pos=s[0]

for i in range(n):
    if pos==2:
        ans+=1
        result+=1
        break
    else:
        pos=s[pos-1]
        ans+=1

if result==0:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
N = int(input())
X = input()
L = len([i for i in X if i == ")"])
R = len(X) - L
X = (L - R) * "(" + X + (len(X) - (L - R)) * ")"
print(X)
# Judge status: Accepted
import heapq

n=int(input())
A=list(map(int, input().split()))
for i in range(n):
    A[i]=A[i]*(-1)
heapq.heapify(A)
ans=0
for i in range(n):
    a=heapq.heappop(A)
    if i==0:
        B=[a]
        heapq.heapify(B)
    else:
        b=heapq.heappop(B)
        ans=ans+b
        heapq.heappush(B, a)
        heapq.heappush(B, a)
print(-ans)
# Judge status: Accepted
n, T = map(int, input().split())
ans = 1001
for i in range(n):
    c, t = map(int, input().split())
    if t <= T and ans >= c:
        ans = c
if ans != 1001:
    print(ans)
else:
    print("TLE")
# Judge status: Accepted
a, b, x = map(int, input().split())
print(b // x - (a -1) // x)