Harryxun/stf_run huggingface dataset:
n=int(input())
ans=0
for i in range(n):
  y=n//i
  ans+=y*(y+1)*i//2
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1):
  y=n//i
  ans+=y*(y+1)*i//2
print(ans)
s,t=list(map(str,input().split()))
a,b=list(map(int,input().split()))
u=str(input())

if s==u:
  a-=1
elif t==u:
  b-=1
  
print(a b)

### FIXED CODE ###

s,t=list(map(str,input().split()))
a,b=list(map(int,input().split()))
u=str(input())

if s==u:
  a-=1
elif t==u:
  b-=1
  
print(a,b)
from collections import Counter
n, k = map(int, input().split())
ps = [input() for _ in range(n)]
heads = Counter((p[0] for p in ps))
ans = 0
while len(heads) >= k:
    ans += 1
    for h, c in heads.most_common()[:k]:
        if c==1:
            heads.pop(h)
        else:
            heads[h] -= 1
print(ans)

### FIXED CODE ###

n, a, b = map(int, input().split())
ts = map(int, (input() for _ in range(n)))
print(sum(1 for t in ts if t<a or t>=b))
import copy
j=0
n,hp=map(int,input().split(" "))
la=[0 for i in range(n)]
lb=[0 for i in range(n)]
for i in range(n):
    la[i],lb[i]=map(int,input().split(" "))
cnt=0
ma=max(la)
lma=[i for i ,x in enumerate(la)  if x==ma]
mib=10**9
for i in lma:
    if lb[i]<mib:
        mib=lb[i]
        k=i
tmp=copy.deepcopy(lb)
while max(tmp)>ma:
    hp-=max(tmp)
    tmp.remove(max(tmp))
    cnt+=1
    if hp<0:
        print(cnt)
        j=1
if hp%ma==0 and j==0:
    print(cnt+int(hp/ma))
elif j==0:
    print(cnt+int(hp/ma)+1)

### FIXED CODE ###

N,H=map(int,input().split())
ab=[]
a=[]
b=[]

for i in range(N):
    ab.append(list(map(int,input().split())))
    a.append(ab[i][0])
    b.append(ab[i][1])

a.sort(reverse=True)
b.sort(reverse=True)
k=0
cnt=0

while a[0]<b[k]:
    H-=b[k]
    cnt+=1
    if H<=0:
        break
    k+=1
    if k==len(b):
        break

#print(cnt,H)
H=max(H,0)

if H%a[0]==0:
    cnt+=H//a[0]
else:
    cnt+=H//a[0]+1

print(cnt)
s = input()
print(700 + s.count(o))

### FIXED CODE ###

s = input()
print(700 + int(s.count("o")*100))
S = input()
ans = 0
ans_lis = []
for x in S:
    if x == 'A' or x == 'C'or x == 'G' or x == 'T':
        ans += 1
    else:
        ans_lis.append(ans)
        ans = 0
print(max(ans_lis))



### FIXED CODE ###

S = input()
ans = 0
ans_lis = [0]
for x in S:
    if x == 'A' or x == 'C' or x == 'G' or x == 'T':
        ans += 1
    else:
        ans_lis.append(ans)
        ans = 0
ans_lis.append(ans)
print(max(ans_lis))
import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
k = range(1,a)
  for s in k:
   res = a/s
   #print("s",s)
   #print("res",res)
   try:
    res = int(res)
   except:
    break
   if is_integer(s):
    if is_integer(res):
     if len(str(s)) == 1:
      if len(str(res)) == 1:
       #print(res,s)
       if res * s == a:
        print("Yes")
        sys.exit() 
print("No")


### FIXED CODE ###

import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
k = range(1,a)
for s in k:
 res = a/s
 #print("s",s)
 #print("res",res)
 try:
  res = int(res)
 except:
  break
 if is_integer(s):
  if is_integer(res):
   if len(str(s)) == 1:
    if len(str(res)) == 1:
     #print(res,s)
     if res * s == a:
      print("Yes")
      sys.exit() 
print("No")
n, x, m = map(int, input().split())

if x == 0:
    print(0)
    sys.exit()

l = [x]
s = {x}
prev = x

for i in range(1, m):
    next = prev ** 2
    next = next % m
    if next in s:
        break
    s.add(next)
    l.append(next)
    prev = next
start = l.index(next)
length = i - start

ans = 0
if n < start + length:
    ans += sum(l[:n])
else:
    ans += sum(l[:start])
    ans += sum(l[start:]) * ((n - start) // length)
    ans += sum(l[start:(start + ((n - start) % length))])

print(ans)


### FIXED CODE ###

import sys

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

if x == 0:
    print(0)
    sys.exit()

l = [x]
s = {x}
prev = x

for i in range(1, m):
    next = prev ** 2
    next = next % m
    if next in s:
        break
    s.add(next)
    l.append(next)
    prev = next
start = l.index(next)
length = i - start

ans = 0
if n < start + length:
    ans += sum(l[:n])
else:
    ans += sum(l[:start])
    ans += sum(l[start:]) * ((n - start) // length)
    ans += sum(l[start:(start + ((n - start) % length))])

print(ans)
def cost(p1, p2):
    return abs(p1 - p2)


input()
points = (0, *map(int, input().split(' ')), 0)

base_cost = sum([cost(p, pre_p) for pre_p, p in zip(points, points[1:])])

for pre_p, p, next_p in zip(points, points[1:], points[2:]):
    diff = cost(pre_p, next_p) - cost(pre_p, p) - cost(p, next_p)
    print(base_cost + diff)


### FIXED CODE ###

from itertools import chain


def cost(p1, p2):
    return abs(p1 - p2)


input()
points = tuple(chain.from_iterable(([0], tuple(map(int, input().split(' '))), [0])))

base_cost = sum([cost(p, pre_p) for pre_p, p in zip(points, points[1:])])

for pre_p, p, next_p in zip(points, points[1:], points[2:]):
    diff = cost(pre_p, next_p) - cost(pre_p, p) - cost(p, next_p)
    print(base_cost + diff)
s = input()
t = input()
if s==t[:-1]
	print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
t=input()
if s==t[:-1]:
	print("Yes")
else:
  	print("No")
a=int(input())
Papers=list(map(int,input().split()))
m=0
for i in range (a):
  if Papers[i] %2==0:
    if not (Papers[i] %3==0 or Papers[i] %5==0):
      m=m+1

if not m=0:
  print("DENIED")
else:
  print("APPROVED")


### FIXED CODE ###

a=int(input())
Papers=list(map(int,input().split()))
m=0
for i in range (a):
  if Papers[i] %2==0:
    if not (Papers[i] %3==0 or Papers[i] %5==0):
      m=m+1

if not m==0:
  print("DENIED")
else:
  print("APPROVED")
h,w=map(int,input().split())
c=0
for i in range(h):
  c+=input().count("#")
print("Possible" if c=h+w-1 else "Impossible")


### FIXED CODE ###

h,w=map(int,input().split())
c=0
for i in range(h):
  c+=input().count("#")
print("Possible" if c==h+w-1 else "Impossible")
import numpy as np
n,m,c = map(int, input().split())
b = np.array([int(i) for i in input().split()])
ans = 0
for ii in range(n):
    a = np.array([int(i) for i in input().split()])
    if (a@b + c) > 0:
        ans += 1
print(ans)


### FIXED CODE ###

import numpy as np
n,m,c = map(int, input().split())
b = np.array([int(i) for i in input().split()])
ans = 0
for ii in range(n):
    a = np.array([int(i) for i in input().split()])
    if (np.dot(a,b) + c) > 0:
        ans += 1
print(ans)
import copy

def main():
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

    def lcm(a, b):
        return int(a / gcd(a, b)) * b

    n, m = map(int, input().split())
    # これだと72がREになる
    A = set([int(x) for x in input().split()])
    # これだと74も78もREになる
    # A = [int(x) for x in input().split()]
    A_ = copy.deepcopy(A)
    a_lcm = A.pop()
    # Aの要素が複数ならlcmを計算する
    if len(A) >= 1:
        for a in A:
            a_lcm = lcm(a_lcm, a)
    else:
        a_lcm = a_lcm
    # 元のAの値とlcmの半分の値を割り切れるものがあったら0
    for i in A_:
        if (a_lcm / 2) % i == 0:
            print(0)
            exit()
        else:
            continue
    # mがlcmの半分よりも小さかったら0
    if a_lcm / 2 > m:
        print(0)
    else:
        # あとは定数倍の数調べて終わり
        # ans = int((m - (a_lcm / 2))) // a_lcm + 1
        ans = int((m - (a_lcm / 2)) // a_lcm) + 1
        print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

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

def nCr(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
b = []
for i in range(m):
    if i == 0:
        b.append(a[i] - 1)
    else:
        b.append(a[i] - a[i - 1] - 2)
b.append(n - a[-1] - 1)
if -1 in b:
    print(0)
    exit()
c = set(b)
d = {}
for i in c:
    k = 0
    s = 1
    while i - k > k:
        s += nCr(i - k, k)
        k += 1
    d[i] = s
ans = 1
for i in b:
    ans *= d[i] % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7))

### FIXED CODE ###

from functools import lru_cache
import sys

sys.setrecursionlimit(1000000)

mod = 10 ** 9 + 7

@lru_cache(maxsize=1000000)
def saiki(i):
    if ok[i]:
        if i == 0:
            return 1
        if i == 1:
            return 1
        return saiki(i - 1) % mod + saiki(i - 2) % mod
    else:
        return 0


n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
ok = [True] * (n + 1)
for i in a:
    ok[i] = False
print(saiki(n) % mod)
res = [0]*x

def woo(x, y):
    z = list(map(int, input().split()))
    for i in range(1, x):
        res[i] = min(abs(z[i] - z[j]) + res[j] for j in range(max(0, i - y), i))
    return res

if __name__ == '__main__':
    x, y = map(int, input().split())
    r = woo(x, y)
    f = len(r)-1
    print(r[f])



### FIXED CODE ###

n, k = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]

def abs(x):
    if x >= 0:
        return x
    return -x

c = [0]
c.append(abs(h[1] - h[0]))
for i in range(2, n):
    cmin = None
    for cur in range(i-1, i-1-k, -1):
        if cur < 0:
            break
        val = abs(h[i] - h[cur]) + c[cur]
        if cmin is None or val < cmin:
            cmin = val
    c.append(cmin)

print(c[-1])
n = int(input())
ans = 0
i = 1

def calc(x):
    x -= 1
    if n // x == n % x:
        return x
    return 0

for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        if i != 1:
            ans += calc(i)
        ans += calc(n // i)
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0
def calc(x):
    x -= 1
    if x <= 0:
        return 0
    elif n // x == n % x:
        return x
    return 0

for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        ans += calc(n // i) + calc(i)
print(ans)
N = int(input())
rootn = int(N**0.5) +1
A = range(1, rootn)
min_digits = 11
for i in A:
    if (N % A) == 0:
        B = N // A
        p, q =len(str(A)), len(str(B))
        if (p > q) and p < min_digits:
            min_digits = p
        elif (p <= q) and q < min_digits:
            min_digits = q
print(min_digits)

### FIXED CODE ###

def f(n):
    rootn = int((N**0.5)+1)
    A = range(1, rootn)
    min_output = 11
    for i in A:
        if (N % i) == 0:
            ilen = len(str(i))
            B = len(str(N//i))
            if ilen < B:
                if min_output > B:
                    min_output = B
            else:
                if min_output > ilen:
                    min_output = ilen
    return min_output
N = int(input())
print(f(N))
import sys
from collections import deque
n = int(input())
a = [deque(map(lambda x:int(x) - 1, input().split())) for _ in range(n)]
q = deque()
pre_q = deque()
day = 0


def check(p, q):
    if len(a[p]) == 0: return
    o = a[p][0]
    if a[o][0] == p:
        if p < o and not (p, o) in q:
            q.append((p, o))
        elif not (o, p) in q:
            q.append((o, p))

for p in range(n):
    check(p, q)

while len(q) > 0:
    day += 1
    pre_q = q.copy()
    q.clear()
    for (p, o) in pre_q:
        a[p].popleft()
        a[o].popleft()
        check(p, q)
        check(o, q)


for i in range(n):
    if not len(a[i]) == 0:
        print(-1)
        sys.exit()

print(day)


### FIXED CODE ###

from collections import deque
import copy, sys

input = sys.stdin.readline
n = int(input())
a = [deque(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]
q = deque()
pre_q = deque()
day = 0

def check(p, q):
    if not len(a[p]):
        return
    o = a[p][0]
    if p == a[o][0]:
        if p > o: p, o = o, p
        if not (p, o) in q:
            q.append((p, o))

fin = []
for p in range(n):
    if not p in fin:
        o = a[p][0]
        if p == a[o][0]:
            q.append((p, o))
            fin += [p, o]

while q:
    day += 1
    pre_q = copy.copy(q)
    q.clear()
    for (p, o) in pre_q:
        a[p].popleft()
        a[o].popleft()
        check(p, q)
        check(o, q)

if all(map(len, a)):
    print(-1)
else:
    print(day)
A, B, C = map(int, input().split())
if A == B:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if C % (A % B) == 0 or (B - C) % (B % A) == 0:
        print('YES')
    else:
        print('NO')

### FIXED CODE ###

A, B, C = map(int, input().split())
C_list = []
if A >= B:
    num = A % B
    while num not in C_list:
        C_list.append(num)
        num += A % B
        if num >= B:
            num -= B
elif A < B:
    num = A
    while num not in C_list:
        C_list.append(num)
        num += A
        if num >= B:
            num -= B
print('YES' if C in C_list else 'NO')
h, k = map(int, input().split())
lis = list(map(int, input().split()))
if h >= k:
    lis.sort(reverse=True)
    lis = lis[k:]
else:
    lis = []
    
print(sum(lis))

### FIXED CODE ###

H, A = map(int, input().split())
from math import ceil
n = int(ceil(H/A))
print(n)
# coding: utf-8

import sys
from collections import deque

#n, q = map(int, input().split())
n = int(input())
tasks = {
    "insert": "appendleft",
    "delete": "remove",
    "deleteFirst": "popleft",
    "deleteLast": "pop"
}

a = deque()

for i in range(n):
    input_line = input()
    if input_line in tasks:
        #deleteFirst,deleteLast
        task = input_line
        eval("a.{}()".format(tasks[task]))
    else:
        #insert,delete
        task, item = input_line.split()
        eval("a.{}({})".format(tasks[task], item))

print(*a)

### FIXED CODE ###

# coding: utf-8

import sys
from collections import deque

n = int(input())

task_name = (
    "insert",
    "delete",
    "deleteFirst",
    "deleteLast",
)

a = deque()

for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()):
    #deleteFirst,deleteLast
    if len(task) == 1:
        if task[0] == "deleteFirst":
            a.popleft()
        else:
            a.pop()

    #insert,delete
    else:
        if task[0] == "insert":
            a.appendleft(task[1])
        elif task[1] in a:
            a.remove(task[1])

print(*a)
h,w = map(int,input().split())
for i in range(h):
    str = input()+"\n"
    print(str*2)

### FIXED CODE ###

print("vowel" if input() in ("a", "i", "u", "e", "o") else "consonant")
N,A,B = map(int, input().split())
ans = 0
S = A+B
T = N//S
U = N%S


if(A == 0):
    ans = 0
else :
    if(0< U < A):
        ans = A*T+U
    elif(U == 0):
        ans = A*T
    elif(U >= A):
        ans = A*T+A
    
print(ans)


### FIXED CODE ###

S = list(input())
ans = 0

for i in range(0,2):
    if(S[i] != S[i+1]):
        ans = 1
        break
    else :
        ans = 0

if(ans == 1):
    print('Yes')
elif(ans == 0):
    print('No')
N = int(input())
A = list(map(int,input().split()))
rank = []

for i in range(1,N+1):
    rank.append(A.count(i))
    


for i in range(0,N+1):
    print(rank[i])
    

### FIXED CODE ###

N = int(input())
A = input().split()

import collections
c = collections.Counter(A)

for i in range(1,N+1):
    print(c[str(i)])
A,B,C,K = map(int, input().split())
card_list = (([1]*A).extend([0]*B)).append([-1]*C)

print(sum(card_list[0:K]))

### FIXED CODE ###

A,B,C,K = map(int, input().split())
ans = 0
if K <= A:
  ans = K
else:
  if K > A and K <= A+B:
    ans = A
  else:
    ans = A-(K-A-B)
print(ans)
N,T = map(int,input().split())
t = list(map(int,input().split()))
sum = 0
sum += t[0]
for i in range(N-1):
  sum += (T,t[i+1]-t[i])
print(sum)
      

### FIXED CODE ###

N,T = map(int,input().split())
t = list(map(int,input().split()))
sum = 0
for i in range(N-1):
  sum += min(T,(t[i+1]-t[i]))
print(sum+T)
for i in range(1, 10):
  for j in range(1, 10):
    print i, "x", j, "=", i * j

### FIXED CODE ###

for i in range(1, 10):
  for j in range(1, 10):
    print(str(i) + "x" + str(j) + "=" + str(i*j))
n = int(input())

if n%2==0:
  print((n/2)**2)
else:
  print((n+1)/2)*((n+1)/2-1)

### FIXED CODE ###

n = int(input())

e = n//2
o = n-e

print(e*o)
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = list(sorted(a_list.count(i) for i in range(n+1),reverse = True))
print(n-sum(b_list[:k:]))

### FIXED CODE ###

import collections
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b = collections.Counter(a_list)
d = b.most_common()[k:]
sum = 0
for i in d:
    sum += i[1]
print(sum)
nums = int( input().split())

i = 0
while i < nums.length:
    print( Case, i, nums[i])
    i += 1

### FIXED CODE ###

count = 1
while True:
    x = input().strip()
    if x == '0':
        break
    else:
        print( 'Case %s: %s' % ( count, x))
        count += 1
a,b,c = sroted(map(int,input().split()))
print(a + b)

### FIXED CODE ###

ring = list(map(int,input().split()))
print(sum(ring) - max(ring))
n = int(raw_input())
 maxv = -1*10**9
 minv = int(raw_input())

 for j in range(n-1):
   num = int(raw_input())
   diff = num - minv
   maxv = max(maxv,diff)
   minv = min(minv,num)
 print maxv

### FIXED CODE ###

n = int(raw_input())
minv = int(raw_input())
maxv = -1*10**9
  
for j in range(n-1):
  nums = int(raw_input())  
  diff = nums - minv
  if maxv < diff:
    maxv = diff
  if nums < minv:
    minv = nums
  
print maxv
S = int(input())

h = S / 60
m = h % 60
s = m % 60

print(h+ ':' + m + ':' + s)

### FIXED CODE ###

S = int(input())

h = S // 3600
m = S // 60 % 60
s = S % 60

#print(h+ ':' + m + ':' + s)
print('{0}:{1}:{2}'.format(h,m,s));
n = input()
a, b = int(n.split())
x = a * b
y = 2 * (a + b)
print(x, y)


### FIXED CODE ###

n = input()
a, b = n.split()
a = int(a)
b = int(b)
x = a * b
y = 2 * (a + b)
print(x, y)
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sumA = 0
sumB = 0
sumAB = 0

for i in range(n):
    sumA += A[i]
    sumB += B[i]

for i in range(n):
    if A[i] < B[i]:
        sumAB += int((b[i] - a[i]) / 2 + 0.5)

if sumAB <= sumB - sumA:
    print("Yes")
else:
    print("No")


### FIXED CODE ###


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

sumA = 0
sumB = 0
sumAB = 0

for i in range(n):
    sumA += A[i]
    sumB += B[i]

for i in range(n):
    if A[i] < B[i]:
        sumAB += int((B[i] - A[i]) / 2 + 0.5)

if sumAB <= sumB - sumA:
    print("Yes")
else:
    print("No")
from copy import deepcopy
from operator import add, sub

class TwoPointers:
    def __init__(self, cond, init=0, right=add, left=sub):
        self.cond = cond
        self.init = init
        self.next_right = right
        self.next_left = left
    
    def __call__(self, A):
        cond = self.cond
        next_right, next_left = self.next_right, self.next_left
        s = deepcopy(self.init)
        n = len(A)
        X = {}
        r = 0
        for l in range(n):
            while r < n and cond(s, A[r]):
                s = next_right(s, A[r])
                r += 1
                X[l] = r
            if l == r:
                r += 1
            else:
                s = next_left(s, A[l]) if l+1 != r else deepcopy(self.init)
        return list(X.items())

n, *A = map(int, open(0).read().split())
X = TwoPointer(lambda s, n: s + n == s ^ n)(A)
print(sum(r-l for l, r in X))

### FIXED CODE ###

n, *A = map(int, open(0).read().split())

ans = s = r = 0
for l in range(n):
    while r < n:
        if s & A[r] != 0:
            break
        s += A[r]
        r += 1
    s -= A[l]
    ans += r-l
print(ans)
def resolve():
    '''
    code here
    '''
    import string
    S = input()

    if S == "zyxwvutsrqponmlkjihgfedcba":
        print(-1)
    else:
        if len(S) < 26:
            temp_str = [item for item in string.ascii_lowercase]
            for item in S:
                temp_str.remove(item)
            print(S+temp_str[0])
            
        else:
            temp_str = [item for item in string.ascii_lowercase]
            temp_str.remove(S[0])
            for i in range(1,26):
                if chr(ord(S[i-1])+1) >= S[i]:
                    temp_str.remove(S[i])
                else:
                    temp_index = i
                    break

            print(S[:temp_index-1] + temp_str[0])





if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    '''
    code here
    '''
    import string
    S = [item for item in input()]
    temp_abc = [item for item in string.ascii_lowercase]

    if len(S) < 26:
        for item in S:
            temp_abc.remove(item)
        res = ''.join(S) + temp_abc[0] 

    else:
        if S == temp_abc[::-1]:
            res = -1
        else:
            tail_inorder = []
            prev = 'a'
            cnt = 0
            for item in S[::-1]:
                if item >= prev:
                    tail_inorder += [item]
                    cnt += 1
                else:
                    break
                prev = item
            end_letter = S[-1*(cnt+1)]
            tail_inorder.sort()
            for item in tail_inorder:
                if end_letter < item:
                    res_end_letter = item
                    break

            res = S[:-1*(cnt+1)] + [res_end_letter]
    print(''.join(res)) if res != -1 else print(res)

if __name__ == "__main__":
    resolve()
from collections import defaultdict

N,M,Q=map(int,input().split())

Goal=[defaultdict(int) for _ in range(N)]
for i in range(M):
    L,R=map(int,input().split())
    Goal[L-1][R-1]+=1

Accumlate = [[0]*(N+1) for i in range(N)]
for g in range(N):
    for l in range(N):
        Accumlate[g][l+1]+=Accumlate[g][l]+Goal[g][l]

ans_list=[]
for l in range(Q):
    ans=0
    L,R=map(int,input().split())
    for l in range(L-1,R):
        ans+=Accumlate[l][R]-Accumlate[l][L-1]
    ans_list.append(ans)

for m in range(Q):
    print(ans_list[m])

### FIXED CODE ###

a,b=map(int,input().split())
print((a-1)*(b-1))
import numpy as np
A,B,N = map(int,input().split())
def f(x):
    return floor(A * x / B) - A * floor(x / B)
def floor(x):
    return x.astype(np.int64)
xArray = np.asarray(range(1,N+1))
score = np.zeros(len(xArray),np.int64)
score += f(xArray)
print(score.max())

### FIXED CODE ###

A,B,N = map(int,input().split())
def f(x):
    return int((A *( x % B ) - (A * x % B)) / B)
if N >= B-1:
    print(f(B-1))
else:
    print(f(N))
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])
  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)
  

### 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=input()
b=input()

ans={1,2,3}
ans.remove(a)
ans.remove(b)
print(ans)


### FIXED CODE ###

a = input("")
b = input("")

a = int(a)
b = int(b)

print(6-a-b)