Harryxun/stf_run huggingface dataset:
from sys import stdin

while True:
    a, op, b = stdin.readline().rstrip().split()
    else if op == '+':
        print(int(a)+int(b))
    else if op == '-':
        print(int(a)-int(b))
    else if op == '*':
        print(int(a)*int(b))
    else if op == '/':
        print(int(a)//int(b))
    else: # op == '?'
        break



### FIXED CODE ###

from sys import stdin

while True:
    a, op, b = stdin.readline().rstrip().split()
    if op == "+":
        print(int(a)+int(b))
    elif op == "-":
        print(int(a)-int(b))
    elif op == "*":
        print(int(a)*int(b))
    elif op == "/":
        print(int(a)//int(b))
    else: # op == "?"
        break
N, M = map(int, input().split())
lis = [0]*N
SC = []
ERROR = False
for _ in range(N):
  sc = list(map(int, input().split()))
  SC.append(sc)
for i in range(len(SC)-1):
  for j in range(i+1,len(SC)):
    if SC[i][0] == SC[j][0] and SC[i][1] != SC[j][1]:
      ERROR = True
if ERROR:
  print('-1')
else:
  output = ''
  if N > 1 and lis[0] == '0':
    print('-1')
  else:
    for i in range(len(SC)):
      lis[SC[i][0]-1] = SC[i][1]
    for i in range(N):
      output += str(lis[i])
    print(output)

### FIXED CODE ###

N, M = map(int, input().split())
lis = [0]*N
SC = []
ERROR = False
for _ in range(M):
  sc = list(map(int, input().split()))
  SC.append(sc)
for i in range(len(SC)-1):
  for j in range(i+1,len(SC)):
    if SC[i][0] == SC[j][0] and SC[i][1] != SC[j][1]:
      ERROR = True
for i in range(len(SC)):
  if N > 1 and SC[i][0] == 1 and SC[i][1] == 0:
    ERROR = True
if ERROR:
  print(-1)
else:
  output = ''
  for i in range(M):
    lis[SC[i][0]-1] = SC[i][1]
  if N > 1 and lis[0] == 0:
    lis[0] = 1
  for i in range(N):
    output += str(lis[i])
  print(int(output))
from operator import itemgetter

def calc(n, A, B):
    count = 0
    for i in range(n-1):#scanA
        if A[i] > B[i]:
            return 'No'
        
        Bmin = B[i]
        swapnum = i
        for j in range(i+1,n):
            if Bmin > B[j]:
                Bmin = B[j]
                swapnum = j            
        
        #A[i+1]<=Bminでなければ入れ替える。
        if A[i+1] > Bmin:
            B[swapnum] = B[i]
            count += 1
        
    if count > n -2:
        return 'No'
    else:
        return 'Yes'

                
#main

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

#print(A)
#print(B)

pair = list(zip(A,B))
pair.sort(key=itemgetter(0))#sortA

A, B = zip(*pair)

ltA = list(A)
ltB = list(B)

#print(ltA)
#print(ltB)

#print(pair)

print(calc(n,ltA,ltB))


### FIXED CODE ###

n = int(input())
print((n-1)//2)
p = str(input())
s = list(p)
k = int(input())

ss = list(set(sorted(s)))
zis = []
for i in ss:
    zis.append(i)
    indexes = [p for p, x in enumerate(s) if x == i]            
    count = 0
    onedict = []
    
    for ii in range(len(indexes)):
        onedict.append(i)
        
    while count <= len(s)  + 1 and len(onedict) <= k + 1:
        count = count + 1
        
        if True:
            quint = indexes
            for sss in range(len(onedict)):
                try:
                    pppp = onedict[sss]
                    pppp = pppp + s[ int(quint[sss])+ count]
                    onedict.append(pppp)
                except:
                    pass
            for jj in onedict:
                zis.append(jj)

                
    if len(zis) > k + 1:
        break
zissort = list(sorted(list(set(zis))))

print(zissort[k-1])
                


### FIXED CODE ###


s = str(input())
k = int(input())
kouho = [s]

for i in range(len(s)):
    for plus in range(k+1):
        st = s[i:i + plus]
        kouho.append(st)
so = list(sorted(set(kouho)))
if '' in so:
    so.remove('')
    
print(so[k-1])
n = input()
a_list = input().split(" ")

def count_divide(number, max_cnt=0):
  count = 0
  mod = -1
  while mod != 1:
    q, mod = divmod(number, 2)
    if mod == 1:
      return count
    count += 1
    if max_cnt != 0 and count >= max_cnt:
      return max_cnt
    number = q
  return count

result = 0
for a in a_list:
  result = count_divide(int(a), result)
print(result)


### FIXED CODE ###

in_str = input()
count = 0
for ch in in_str:
  if ch == "1":
    count += 1
print(count)
while True:
    a,b,c=map(str,raw_input().split())
    a,c=int(a),int(c)
    if b=="?":
        break
    if   b=="+":
        print(a+c)
    elif b=="-":
        print(a-c)
    elif b=="*"
        print(a*c)
    else:
        print(a//c)
    

### FIXED CODE ###

while True:
    a,b,c=map(str,raw_input().split())
    a,c=int(a),int(c)
    if b=="?":
        break
    if   b=="+":
        print(a+c)
    elif b=="-":
        print(a-c)
    elif b=="*":
        print(a*c)
    else:
        print(a//c)
N,R = map(int,input().split())
if N <= 10:
    print(R)
else:
    print(R + 1000 -10*K)

### FIXED CODE ###

N,R = map(int,input().split())
if N >= 10:
    print(R)
else:
    print(R + 1000 -100*N)
def circle_in_rectangle(radius, pos, height, width):
    """ 
    radius: int
    pos: tuple, (x, y)
    height: int, height of rectangle
    width: int, width of rectangle

    returns True if circle is in rectangle, otherwise False

    >>> circle_in_rectangle(1, (1, 1), 4, 5)
    True
    >>> circle_in_rectangle(1, (2, 4), 4, 5)
    False
    """
    (x, y) = pos 
    if x < radius or x > width - radius:
        return False

    if y < radius or y > height - radius:
        return False

    return True

if __name__ == '__main__':

    (w, h, x, y, r) = input().split(' ')

    if circle_in_rectangle(int(r), (int(x), int(y)), int(h), int(w)):
        print('Yes')
    else:
        print('No')
~                                              

### FIXED CODE ###

def circle_in_rectangle(radius, pos, height, width):
    """
    radius: int
    pos: tuple, (x, y)
    height: int, height of rectangle
    width: int, width of rectangle

    returns True if circle is in rectangle, otherwise False

    >>> circle_in_rectangle(1, (1, 1), 4, 5)
    True
    >>> circle_in_rectangle(1, (2, 4), 4, 5)
    False
    """
    (x, y) = pos
    if x < radius or x > width - radius:
        return False

    if y < radius or y > height - radius:
        return False

    return True

if __name__ == '__main__':
    #import doctest
    #doctest.testmod()

    (w, h, x, y, r) = input().split(' ')

    if circle_in_rectangle(int(r), (int(x), int(y)), int(h), int(w)):
        print('Yes')
    else:
        print('No')
X, Y = map(int, input().split())
if X==Y:
  print("=")
elif X>Y:
  print(">")
else:
  print("<")

### FIXED CODE ###

S = input()
X, Y = S[0], S[2]

if X == Y:
  print("=")
elif X > Y:
  print(">")
else:
  print("<")
if a**0.5 + b**0.5 < c**0.5
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c = map(int,input().split())
#if math.sqrt(a)+math.sqrt(b) < math.sqrt(c):
if c-a-b> 0 and (c-a-b)**2 > 4*a*b:
    print("Yes")
else:
    print("No")
a, b = map(int, input().split())
if a <= b:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

a, b = map(int, input().split())
if a <= b:
    print("unsafe")
else:
    print("safe")
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt = 0
for i in range(len(n)):
    if v[i] > c[i]:
        cnt += (v[i] - c[i])
    else:
        cnt += 0
print(cnt)        


### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if v[i] > c[i]:
        cnt += (v[i] - c[i])
print(cnt)
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0

for i in range(min(a, x//a)+1):
  for j in range(min(b, (x-500*i)//100)+1):
    p=x-500*i-100*j
    if p<=50*c:
      ans+=1
print(ans)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0

for i in range(min(a, x//500)+1):
  for j in range(min(b, (x-500*i)//100)+1):
    if x-500*i-100*j <= 50*c:
      ans+=1
print(ans)
from math import ceil 
L=[]
M=9
X=0
for i in range(5) :
  A=int(input())
  L.append(A)
  if A%10 < M%10 and A%10!=0 :
    M=A
L.remove(M)
for i in L :
  X+=ceil(i/10)*10
print(X+M)

### FIXED CODE ###

from math import ceil 
L=[]
X=0
M=int(input())
L.append(M)
for i in range(4) :
  A=int(input())
  L.append(A)
  if A%10 < M%10 and A%10!=0 :
    M=A
L.remove(M)
for i in L :
  X+=ceil(i/10)*10
print(X+M)
import sys

size = int(input())
a = map(int, input().split())
cnt = 0

while True:
  for i in range(size):
    if(a[i]%2 == 1):
      print(cnt)
      sys.exit()
    
  a = map(lambda x:x/2, a)
  cnt+=1
  

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
N = int(input())
xyh = [list(map(int, input().split())) for _ in range(N)]

for x in range(101):
    for y in range(101):
        check = []
        for d in xyh:
            ifd0 = False
            if d[2] == 0:
                ifd0 = True
            ch = abs(d[0] - x) + abs(d[1] - y) + d[2]
            check.append([ch, ifd0])
        ifans = True
        for c in check:
            if c[0] - check[0][0] != 0:
                if ifd0:
                    continue
                ifans = False
                break
        if ifans:
            ans = [x, y, ch]
            break

print(' '.join([str(a) for a in ans]))

### FIXED CODE ###

N = int(input())
P = [list(map(int, input().split())) for _ in range(N)]

for cx in range(101):
    for cy in range(101):
        H = -1
        ok = True
        for x, y, h in P:
            if h == 0:
                continue
            Hi = abs(x-cx) + abs(y-cy) + h
            if H == -1:
                H = Hi
                continue
            if Hi != H:
                ok = False
                break
        if not ok:
            continue
        for x, y, h in P:
            if h != max(H-abs(cx-x)-abs(cy-y), 0):
                ok = False
        if ok:
            print(cx, cy, H)
            break
    if ok:
        break
print(x**3)

### FIXED CODE ###

x = int(input())
print (x**3)
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
for i in range(5):
    X = Y[i][1]
    #print(i)
    while X % 10 != 0:
        X += 1
    ans += X
    #print(X)
    #print(ans)
G = Y[Z[0]][1]
while G % 10 != 0:
    G += 1
ans -= G
ans += Y[Z[0]][1]
#print(tmp[0])
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
if len(Z) != 0:
    for i in range(5):
        X = Y[i][1]
        #print(i)
        while X % 10 != 0:
            X += 1
        ans += X
        #print(X)
        #print(ans)
    G = Y[Z[0]][1]
    while G % 10 != 0:
        G += 1
    ans -= G
    ans += Y[Z[0]][1]
    #print(tmp[0])
else:
    ans = sum(tmp)
print(ans)
nm = list(map(int, (input().split())))
if nm[1] == 0:
    print(0, 0)

else:    
    ans_dict = {}
    ans_list = [input().split() for i in range(nm[1])]
    for i in range(len(ans_list)):
        key_val = ans_list[i][0]

        try:
            ans_dict[key_val].append(ans_list[i][1])
        except:
            ans_dict[key_val] = [ans_list[i][1]]
    ans_cnt = 0
    wa_cnt = 0
    for key_val in ans_dict.keys():
        check_list = ans_dict[key_val]

        if "AC" in check_list:
            ans_cnt += 1
        else:
            pass
        try:
            check_list.index("AC")
            wa_cnt += len(check_list[:check_list.index("AC")])
        except:
            pass
print(ans_cnt, wa_cnt)    

### FIXED CODE ###

nm = list(map(int, (input().split())))
if nm[1] == 0:
    print(0, 0)

else:    
    ans_dict = {}
    ans_list = [input().split() for i in range(nm[1])]
    for i in range(len(ans_list)):
        key_val = ans_list[i][0]

        try:
            ans_dict[key_val].append(ans_list[i][1])
        except:
            ans_dict[key_val] = [ans_list[i][1]]
    ans_cnt = 0
    wa_cnt = 0
    for key_val in ans_dict.keys():
        check_list = ans_dict[key_val]

        if "AC" in check_list:
            ans_cnt += 1
        else:
            pass
        try:
            wa_cnt += len(check_list[:check_list.index("AC")])
        except:
            pass
    print(ans_cnt, wa_cnt)
n = int(input())
A = list(map(int, input().split()))
result = 1
for i in range(n-1):
  if A[i]!=A[i+1]:
  	result = result + 1
print(result)

### FIXED CODE ###

n = int(input())
A = list(input())
result = 1
for i in range(n-1):
  if A[i]!=A[i+1]:
  	result = result + 1
print(result)
import math

N=int(input())
result=0

for i in range(1,int(math.sqrt(N))+1):
    if N%i==0:
        if i>1 and N%(i-1)==N//(i-1):
            result+=i-1
        if N%i!=N//i:
            if N%(N//i-1)==N//(N//i-1):
                result+=N//i-1
print(result)

### FIXED CODE ###

import math

N=int(input())
result=0
if N==1:
    print(0)
else:
    for i in range(1,int(math.sqrt(N))+1):
        if N%i==0:
            if i>1 and N%(i-1)==N//(i-1):
                result+=i-1
            if N%i!=N//i:
                if N%(N//i-1)==N//(N//i-1):
                    result+=N//i-1
    print(result)
int(a)
int(b)
print(2a+2b)


### FIXED CODE ###

a,b = [int(x) for x in input().split()]

s = a*b

p = 2*a+2*b

print(s,p)
import math
a, b, c = map(int, input().split())
for i in range(1, 9):
while (a % i == 0 and b % i == 0 and c % i == 0):
  if (a == i or b == i or c == i):
    break
  a /= i
  b /= i
  c /= i
left = a * b
right = (c - (a + b)) / 2
right = right ** 2
if (left < right):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

a, b, c = map(int, input().split())
left = 4 * a * b
right = c - (a + b)
if (right < 0):
  print('No')
  exit()
right = right ** 2
if (left < right):
  print('Yes')
else:
  print('No')
def main():
  n=int(input())
  heights=list(map(int,input.split()))
  assert len(heights)==n
  i=0
  count=0
  while i<n:
    j=i+1
    while j<n:
      if heights[i]+heights+[j]==(j-i):
        count+=1
  print(count)
main()

### FIXED CODE ###

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    from collections import defaultdict
    count = defaultdict(int)
    ans = 0
    for i, a in enumerate(A):
        if i - a in count:
            ans += count[i-a]
        count[i+a] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()
def checker(x1,y1,x2,y2,xp,yp):
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		return 1
	elif vec < 0:
		return -1

while True:
	try:
		x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
		r = checker(x1,y1,x2,y2,xp,yp)
		r += checker(x2, y2, x3, y3, xp, yp)
		r += checker(x3, y3, x1, y1, xp, yp)
		if r == 3 or r == -3:
			print("YES")
		else:
			print("NO")
	except EOFError:
		break

### FIXED CODE ###

def checker(x1,y1,x2,y2,xp,yp):
	r = 0
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		r = 1
	elif vec < 0:
		r = -1
	return r

if __name__ == '__main__':
	while True:
		try:
			x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
			r = 0
			r += int(checker(x1,y1,x2,y2,xp,yp))
			r += int(checker(x2, y2, x3, y3, xp, yp))
			r += int(checker(x3, y3, x1, y1, xp, yp))
			if r == 3 or r == -3:
				print("YES")
			else:
				print("NO")
		except EOFError:
			break
a,b=map(int,input().split())
print(a*b,(a+b)*2

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,(a+b)*2)
n, m = map(int, input().split())
s = list(input())
t = list(input())

def gcd(a, b):
    while b != 0:
        c = a%b
        a = b
        b = c
    return a

ans = n*m//gcd(n, m)
sp_a, sp_b = ans//n, ans//m
l = [False]*ans
jud = True
for i in range(n):
    l[i*sp_a] = s[i]

for i in range(m):
    if not l[i*sp_b]:
        l[i*sp_b] = t[i]
    else:
        if l[i*sp_b] != t[i]:
            jud = False
            break
if jud:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

from math import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())
g = gcd(n, m)
ans = n*m//g
sp_a, sp_b = m//g, n//g
jud = True
for i in range(ans//sp_a):
    if i*sp_a % sp_b == 0:
        if s[i % n] != t[i*sp_a//sp_b]:
            jud = False

if jud:
    print(ans)
else:
    print(-1)
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd
readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]



def main():
    n = readInt()
    a = readInt()
    b = readInt()
    result = 'Hello World' if n == 1 else (a + b)
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd
readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]



def main():
    n = readInt()
    result = 'Hello World'
    if n == 2:
        a = readInt()
        b = readInt()
        result = a + b
    print(result)

if __name__ == '__main__':
    main()
n=int(input())
s,p=list(input().split())

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

new_li=sorted(li,key=lambda x:x[1])

new2_li=sorted(new_li,key=lambda x:x[2] , reverse=True)

for j in range(0,n):
  print(new2_li[j][0])


### FIXED CODE ###

n=int(input())

li=[]

for i in range(0,n):
  s,p=input().split()
  p=int(p)
  li.append((i+1,s,p))


new_li=sorted(li,key=lambda x:x[2] , reverse=True)
new2_li=sorted(new_li,key=lambda x:x[1])


for j in range(0,n):
  print(new2_li[j][0])
N = int(input())
A = list(input().split())
ans = 1
lim = 18
Leng = ''.join(A)
flag = False

if Leng < lim:
    flag = True

for i in A:
    ans *= int(i)

if not flag and "0" not in A:
    print('-1')
else:
    print(ans)

# print(ans, lim)


### FIXED CODE ###

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

ans = 1
if 0 in a:
    print(0)
    exit()

for i in a:
    ans *= i
    if ans > 1e18:
        break

if ans > 1e18:
    print(-1)
else:
    print(ans)
a = list(input())
a.reverse()
add = 0
ans = [1] + [0] * 2018
ans_int = 0

for i in range(len(a)):
    add = (add + int(a[i]) * 10 ** i) %2019
    if ans[add] == 1:
        ans_int += 1
        continue
    else:
        ans[add] = 1


print(ans_int)

### FIXED CODE ###

s,w = map(int,input().split())
if w >= s:
    print("unsafe")
else:
    print("safe")
word = 'keyence'
l = input()
now = 0
start = False
for w in l:
  if word[now] == w:
    now += 1
  else:
    if start:
      return
    else:
      start = True
  if now == len(word):
    print('YES')
    exit()
print('NO')


### FIXED CODE ###

word = 'keyence'
l = input()
i = l.find(word)
if i == 0 or i == (len(l)-len(word)) :
  print('YES')
  exit()

for i in range(1,len(word)):
  a = word[:i]
  b = word[i:]
  #print(l[:len(a)], l[-len(b):])
  if l[:len(a)] == a and l[-len(b):] == b:
    print('YES')
    exit()
print('NO')
n, m = map(int, input().split())
s = input()
len_s = len(s)
inf = 10 ** 18
dp = [[inf,inf] for _ in range(len_s)] # [iまでの手数,一つ前のマス]
for i in range(1, m+1):
    if s[i] == "0":
        dp[i][0] = 1
        dp[i][1] = 0
for i in range(m+1, n+1):
    if i == "1":
        continue
    for j in range(1, m+1)[::-1]:
        if dp[i][0] > dp[i-j][0] + 1:
            dp[i][0] = dp[i-j][0] + 1
            dp[i][1] = i - j
if dp[-1][0] == inf:
    print(-1)
else:
    ans = ""
    x = len_s - 1
    while x > 0:
        ans = str(x - dp[x][1]) + " " + ans
        x = dp[x][1]
    print(ans.strip())


### FIXED CODE ###

from sys import exit
n, m = map(int, input().split())
s = input()

one_sequence = 0
for i in range(1, n):
    if s[i] == "1":
        one_sequence += 1
        if one_sequence == m:
            print(-1)
            exit()
    else:
        one_sequence = 0

pos = n
ans = ""
while pos != 0:
    for i in range(1, m+1)[::-1]:
        if pos-i < 0:
            continue
        if s[pos-i] != "1":
            ans = str(i) + " " + ans
            pos -= i
            break
print(ans)
import math
A, B = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))

### FIXED CODE ###

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

print(lcm(A, B))
r = map(int, input())
print(3 * r * r)

### FIXED CODE ###

r = input()
r = int(r)
print(3 * r * r)
N = int(input())
A = list(map(int, input()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(ans)

### FIXED CODE ###

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

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(round(ans, 6))
A, B, C, K = map(int, input().spliit())
if K <= A :
    return K

elif K <= A + B:
    return A

else:
    return A - (K - (A + B))


### FIXED CODE ###

A, B, C, K = map(int, input().split())
if K <= A :
    print(K)

elif K <= A + B:
    print(A)

else:
    print(A - (K - (A + B)))
a,b,c = map(i, input().split())
ret = 0
for i in range(a,b+1):
    if c % i == 0:
        ret += 1
print(ret)


### FIXED CODE ###

#
# 3d
#

def main():
    a, b, c = map(int, input().split())
    r = 0
    for i in range(a, b+1):
        if c % i == 0:
            r += 1
    print(r)


if __name__ == '__main__':
    main()
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
a.pop(0)
b.pop(0)

ans = []
for i in range(n):
    if a[i] <= k:
        for j in reversed(range(m)):
            if a[i]+b[j] <= k:
                ans.append(i+j+2)
                break
print(max(ans))

### FIXED CODE ###

from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])

ans = 0
j = m
for i in range(n+1):
    if a[i] > k:
        break
    else:
        while a[i]+b[j] > k:
            j -= 1
        ans = max(ans, i+j)
print(ans)