peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import bisect

n = int(input())
aList = sorted(list(map(int,input().split())))
bList = sorted(list(map(int,input().split())))
cList = sorted(list(map(int,input().split())))
#print("aList",aList)
#print("bList",bList)
#print("cList",cList)

count = 0
for i in bList:
  idxA = bisect.bisect_left(aList,i)
  idxC = bisect.bisect_right(cList,i)
#  print("idxA",idxA)
#  print("idxC",idxC)

  count += (idxA)*(n-idxC)
#  print("count",count)
print(count)
# Judge status: Accepted
import fractions
a,b = map(int, input().split())
k = fractions.gcd(a,b)
print(a * b // k)
# Judge status: Accepted
def main():
  n=int(input())
  a=list(map(int,input().split()))
  a.sort()
  a_max=a[-1]
  x=[True]*(a_max+1)
  a=a+[0]
  for i in range(n):
    ai=a[i]
    if x[ai]:
      l=a_max//ai-1
      aj=ai
      for _ in range(l):
        aj+=ai
        x[aj]=False
    if a[i]==a[i+1]:
      x[a[i]]=False
  ans=0
  x[0]=False
  for i in a:
    if x[i]:
      ans+=1
  print(ans)
if __name__=='__main__':
  main()
# Judge status: Accepted
H1, M1, H2, M2, K = map(int, input().split())

print((H2 * 60 + M2 - K) - (H1 * 60 + M1))
# Judge status: Accepted
A, B, C = map(int, input().split())

if (B/A) >= C:
    print(C)
else:
    print(int(B/A))
# Judge status: Wrong Answer
X = int(input())
N = int(X**(1/5))
ans = [0,0]
for i in range(N+1):
  for j in range(-N, i+1):
    if i**5-j**5==X:
      ans = [i, j]
ans = [str(i) for i in ans]
ans = ' '.join(ans)
print(ans)
# Judge status: Accepted
n = int(input())
m = list(str(n))
if m[0] == m[1] == m[2]:
    print(n)
else:
    for i in range(1, 10):
        if n<=i*111:
            print(i*111)
            break
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

import math

big = 10**9 + 7

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

A = []
for a in row_A:
    A.append(a%big)


num = A[0]
set_A = set(A)

for a in set_A:
    num = num * a * pow(math.gcd(num, a),big-2,big)

res = 0
for a in A:
    res += num//a % big

print(res%big)
# Judge status: Accepted
n = int(input())
s = input()
x = 0
ans = 0

for c in s:
  if c == "I":
    x += 1
  else:
    x -= 1
  if x > ans:
    ans = x

print(ans)
# Judge status: Accepted
s = input(); t = input()
count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
print(count)
# Judge status: Wrong Answer
N = int(input())
ans = 0
max_devide_count = 0

for i in range(N, 0, -1):
    
    binary_i_reverse = bin(i)[:1:-1]
    devide_count = 0
    
    for j in binary_i_reverse:
        if j == '0':
            devide_count += 1
        else:
            break
    
    if max_devide_count < devide_count:
        max_devide_count = devide_count
        ans = i

print(ans)
# Judge status: Wrong Answer
import math
a, b = map(int, input().split())
n = int(a+b)
sq=int(math.sqrt(n))

if n/sq == sq:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
def main():
    n = int(input())
    start_word = input()

    used_words = [start_word]
    result = 'Yes'
    for _ in range(n-1):
        word = input()
        if used_words[-1][-1] == word[0] and word not in used_words:
            used_words.append(word)
        else:
            result = 'No'
            break

    print(result)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import numpy as np
n, max_w = map(int, input().split())

dp = [0]*(max_w+1)
dp = np.array(dp)

for _ in range(n):
    w, v = map(int, input().split())
    np.maximum(dp[:-w] + v, dp[w:], out=dp[w:])

print(max(dp))
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
result = 0
tmp = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        tmp +=1
        result = max(result,tmp)
    else:
        tmp = 0
print(result)
# Judge status: Wrong Answer
n,m = map(int, input().split())
a = list(map(int, input().split()))

from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

aset=set(a)
a=list(aset)

if len(a) != 1:
    for i in range(len(a)):
        tmp = a[i]//2
        if tmp%2==0:
            print(0)
            exit()

num = lcm(a)
thr = m - num//2

if thr < 0:
    print(0)
else:
    print(thr//num + 1)
# Judge status: Accepted
h,a=map(int,input().split())
count=0
while True:
    h-=a
    count+=1
    if h<=0:
        print(count)
        exit()
# Judge status: Accepted
def __gcd__(m,n):
    x,y=max(m,n),min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x,y=y,z
        else:
            return z
        
from functools import reduce
def GCD(*X):
    return reduce(__gcd__,X)

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

Q=M//N
R=M%N

for i in range(Q,0,-1):
    if M%i==0:
        print(i)
        break
# Judge status: Wrong Answer
a, b = map(int,input().split())

p1 = int(a // 0.08 + 1)
p2 = int(b // 0.1 + 1)

p1_list = [i for i in range(p1,p1+13)]
p2_list = [i for i in range(p2,p2+10)]

p_list = set(p1_list) & set(p2_list)

p_list = list(p_list)
p_list = sorted(p_list)

if len(p_list) == 0:
    print(-1)
else:
    print(p_list[0])
# Judge status: Accepted
n = int(input())
l = list(input())
if len(l) <= n:
    print("".join(l))
elif len(l) > n:
    del l[n:]
    print("".join(l) + "...")
# Judge status: Accepted
w,h,x,y=map(int,input().split())
p=w*h/2
a=1 if 2*x==w and 2*y==h else 0
print(p,a)
# Judge status: Accepted
n = int(input())
a = int(input())

amari = n % 500

if amari <= a:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import bisect

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

ans = 0
for i in range(n):
  index_a = bisect.bisect_left(a, b[i])
  index_c = bisect.bisect_right(c, b[i])
  
  ans += index_a * (n - index_c)
  
print(ans)
# Judge status: Wrong Answer
N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]

dp = [[0 for i in range(3)] for j in range(N+1)]


for i in range(1, N+1):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j], dp[i-1][k]+l[i-2][k])

print(max(dp[N][0], dp[N][1], dp[N][2]))
# Judge status: Wrong Answer
d, n = map(int,input().split())

print(100 ** d * n)
# Judge status: Wrong Answer
N = int(input())
d = list(map(int, input().split()))

same = N / 2

d.sort()

distribution = [0] * d[len(d) - 1]
total = 0
for di in d:
    num = d.count(di)
    distribution[di - 1] = num

print(distribution)

total = 0
totals = [0] * d[len(d) - 1]
num = 0
for i in range(len(distribution)):
    total += distribution[i]
    totals[i] = total

    if totals[i] == same:
        num += 1
    elif num >= 1:
        break

print(num)
# Judge status: Accepted
S = input()

s1 = int(S[0:2])
s2 = int(S[2:4])

if 1 <= s1 <= 12 :
    if 1<= s2 <= 12:
        print("AMBIGUOUS")
    else :
        print("MMYY")
elif 1 <= s2 <= 12:
    print("YYMM")
else :
    print("NA")
# Judge status: Wrong Answer
W,H,x,y = map(int, input().split())
if x==y==0 or (x==W and y==0) or (x==0 and y==H) or (x==W and y==H):
    print(W*H/2, 0)
    exit()

X = min(x, W-x) * H
Y = min(y, H-y) * W
ans = 0
if X == Y: ans = 1

if x==0 or x==W: print(Y, 0)
elif y==0 or y==H: print(X, 0)
else: print(max(X,Y), ans)
# Judge status: Accepted
from bisect import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

a.sort()
b.sort()
c.sort()

ans = 0
for i in range(n):
    ans += bisect_left(a, b[i])*(n-bisect_right(c, b[i]))

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
x = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]
if x.index(a) > x.index(b):
    print('Alice')
elif x.index(a) < x.index(b):
    print('Bob')
else:
    print('Draw')
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print("Yes" if a*2+b*2>=c else "No" )
# Judge status: Wrong Answer
s = int(input())
mod = 10**9 + 7

# dp[i]: 最後に切った場所がi
dp = [0]*(s + 1)
dp[0] = 1

for i in range(3, s+1):
    for j in range(3, (i-3)+1):
        dp[i] += dp[j]
        dp[i] %= mod

print(dp[s])
# Judge status: Accepted
S = {i:list(input()) for i in "abc"}
n = "a"
while S[n]:
    n = S[n].pop(0)

print(n.upper())
# Judge status: Accepted
n, a, b = map(int, input().split())
d = b - a
if d % 2 == 0:
    print(d//2)
else:
    dd = d//2
    ans = min(dd + a, n - b + 1 + dd)
    print(ans)
# Judge status: Wrong Answer
a,b = input().split()

a = int(a+b)

for i in range(101):
    if i ** 2 == a:
        print("Yes")
        exit(0)
else:
    print("No")
# Judge status: Accepted
X, Y, Z = map(int,input().split())
print(Z, X, Y)
# Judge status: Accepted
a = int(input())

s = input()

if a >= 3200:
    print(s)

elif a < 3200:
    print('red')
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1,2):
  res = 0
  for j in range(1,i+1):
    if i % j == 0:
      res +=1
    if res == 8:
      ans +=1
print(ans)
# Judge status: Accepted
import math

a,b,n = map(int,input().split())
ans=0
c = 0

if n >= b:
  c = b-1
else:
  c = n

ans = math.floor(c*a/b)-a*(math.floor(c/b))
print(ans)
# Judge status: Wrong Answer
n=int(input())
A=list(map(int,input().split()))

cnt=0
for i in range(n):
    for j in range(i+1,n):
        if A[i]==A[j]:
            cnt+=1

if cnt>1:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
A.sort()
NG = [x for x in set(A) if A.count(x) > 1]
A = list(set(A))

sum = 0

while True:
    X = A.pop(0) #左端をとる
    
    i = len(A)
    for Y in reversed(A):
        i -= 1

        if Y%X == 0:
            A.pop(i)

    if NG.count(X) == 0:
        sum += 1

    if len(A) == 0:
        break

print(sum)
# Judge status: Accepted
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
F = sys.stdin

H,N = map(int,F.readline().split())
a = list(map(int,F.readline().rstrip().split()))
a_sum = 0
for num in a:
    a_sum += num

if a_sum >= H:
    print('Yes')
    sys.exit()

print('No')
# Judge status: Accepted
a = list(str(input()))
b = list(str(input()))
c = list(str(input()))
n = a.pop(0)
m = 0
while True:
    if n == 'a':
        if len(a) == 0:
            break
        n = a.pop(0)
    elif n == 'b':
        if len(b) == 0:
            break
        n = b.pop(0)
    else:
        if len(c) == 0:
            break
        n = c.pop(0)
print(n.upper())
# Judge status: Wrong Answer
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

ans = 'No'

# a1b1, a1b2, a1b3
# a2b1, a2b2, a2b3
# a3b1, a3b2, a3b3

for i in range(c11):
  a1 = i
  b1 = c11 - a1
  a2 = c21 - b1
  b2 = c12 - a1
  a3 = c31 - b1
  b3 = c13 - a1
  
  if (a2+b2 == c22) and (a2+b3 == c23) and (a3+b2 == c32) and (a3+b3 == c33):
    ans = 'Yes'
    break
print(ans)
# Judge status: Wrong Answer
a,b,c= map(int, input().split())
if b<=c<=a: print('Yes')
else: print('No')
# Judge status: Accepted
N, M = map(int, input().split())

if N >= M//2 :
    print(M//2)
else :
    print(N + (M - 2*N)//4)
# Judge status: Wrong Answer
s = str(input())
t = str(input())

S = list(s)
T = list(t)

def list_difference(list1, list2):
    result = list1.copy()
    for value in list2:
        if value in result:
            result.remove(value)

    return result

result = list_difference(S, T)

print(len(result))
# Judge status: Accepted
N,L = map(int,input().split())
A = 0
cnt = 0
M = []

for i in range(1,N+1):
    A = L+i-1
    M.append(A)
    if A == 0:
        cnt += 1

B = sum(M)

if cnt == 1:
    print(B)
elif B > 0:
    print(B - min(M))
else:
    print(B - max(M))
# Judge status: Accepted
A, B, m, = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))


ans = min(a) + min(b)
for _ in range(m):
    x, y, c = map(int, input().split())
    ans = min(ans, a[x-1] + b[y-1] - c)

print(ans)
# Judge status: Accepted
S=input()
T=input()
from collections import*
cs=Counter(S)
ct=Counter(T)
csv=sorted(cs.values())
ctv=sorted(ct.values())
print('YNeos'[csv!=ctv::2])
# Judge status: Accepted
s = input()
rs = set(s)
if len(s) == len(rs):
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
def read(n):
    if n%10==2 or 4 or 5 or 7 or 9:
        return 'hon'
    elif n%10==0 or 1 or 6 or 8:
        return 'pon'
    else:
        return 'bon'
# Judge status: Wrong Answer
H,N=map(int,input().split())
A=list(map(int, input().split()))
HP=H
for i in range(N):
    HP-=A[i]
if HP<=0:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
w,a,b = map(int,input().split())

if a == w or b == w:
    print(0)
elif a < b:
    print(b - (a + w))
else:
    print(a - (b + w))
# Judge status: Accepted
n = int(input())
d = list(map(int,input().split()))
d.sort()

m = n//2

x,y = d[m-1:m+1]
ans = y - x
print(ans)
# Judge status: Accepted
N = int(input())
a = N // 15

ans = 800*N - 200*a
print(ans)
# Judge status: Accepted
n,m =map(int,input().split())

a =  sorted([int(x)//2 for x in input().split()],reverse=True)

import fractions

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

import math

lcm1 = 1
for i in a:
    lcm1 = lcm(lcm1, i)
    if((lcm1//i)%2==0):
        print(0)
        exit()

print(math.ceil((m//lcm1)/2))
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
#print(a,b,c)

if a+b == c or b+c == a or c+a == b:
  print("YES")
else:
  print("NO")
  
#d = list(map(int,input().split()))
#print(d)

#if sum(d) - max(d) == max(d):
  #print("YES")
#else:
  #print("NO")
# Judge status: Wrong Answer
N, K = map(int,input().split())
A = sorted(map(int,input().split()))
start = 0
end = A[-1]
while end - start >= 1:
   l = (start + end)/2
   count = 0
   for i in range(N):
      count += (A[i]-1)//l
   if count > K:
      start = l
   else:
      end = l
print(int(l))
# Judge status: Accepted
k = int(input())

flag = 0
count = len(str(k))

if k % 2 == 0:
  print(-1)
  exit()
  
if str(k)[-1] == '5':
  print(-1)
  exit()

count = len(str(k))
test = int('7' * count)
amari = test % k
while True:
  if amari == 0:
    break
  else:
    amari = (amari * 10 + 7) % k
    count += 1
  
print(count)
# Judge status: Accepted
x = int(input())
for i in range(1,10000):
  if i*360%x == 0:
    print(i*360//x)
    break
# Judge status: Wrong Answer
N, K = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort(reverse=True)
ans = 0

if N <= K:
  print(N)
else:
  print(sum(lst[K:])+K)
# Judge status: Accepted
n = int(input())
s = []
for _ in range(n):
    s.append(str(input()))
m = int(input())
t = []
for _ in range(m):
    t.append(str(input()))
a = []
for i in s:
    if i not in a:
        a.append(i)
for i in t:
    if i not in a:
        a.append(i)
b = []
for i in a:
    x = s.count(i)
    y = t.count(i)
    b.append(x - y)
print(max(0, max(b)))
# Judge status: Accepted
menu = [int(input()) for i in range(5)]
def kuriage(n):
    if n %10 == 0:
        return 0
    else:
        return 10-(n %10)
ans = 0
mini = 10
k = 5
for i in range(5):
    if menu[i] %10 < mini and menu[i]%10 !=0:
        mini = menu[i] %10
        k = i
for i in range(5):
    if i == k:
        menu[i], menu[-1] = menu[-1], menu[i]

for i in range(5):
    if i != 4:
        ans += menu[i] + kuriage(menu[i])
    else:
        ans += menu[-1]
        print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
if 2*n <= m:
    print((n+m//2)//2)
else:
    print(m//2)
# Judge status: Accepted
N=int(input());print(N*(N+1)//2)
# Judge status: Wrong Answer
from  collections import Counter

s = list(input())
count = Counter(s)

print(min(count.values())*2)
# Judge status: Accepted
N = int(input())
search_max = int(N**0.5)
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
print(min_number-2)
# Judge status: Accepted
a=int(input())
if a%2==1:
  print((a//2)*(a//2+1))
else:
  print((a//2)**2)
# Judge status: Accepted
S=input()
cnt = 0
for i in range(len(S)//2):
    if S[i] != S[len(S) - i - 1]:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if (a+b)//3>0:
  print('Possible')
else:
  print('Impossible')
# Judge status: Accepted
s = input()

if s[1] == "R":
  print(s.count("R"))
else:
  if "R" in s:
    print(1)
  else:
    print(0)
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))
mod0, mod1 = 0, 0
for a in A:
  if a % 2 == 0: mod0 += 1
  else: mod1 += 1
#print(mod0, mod1)

from math import factorial
comb0 = 2 ** mod0
comb1 = 0
if mod1 > 0:
  for i in range(P, mod1+1, 2):
    comb1 += factorial(mod1) // (factorial(mod1 - i) * factorial(i))
else:
  if P == 0:
    comb1 = 1
ans = comb0 * comb1
#print(comb0, comb1)
print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
ans = 0
for i in range(a,b):
    j = str(i)
    if j[0]== j[-1] and j[1] == j[-2]:
        ans += 1

print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
s = input()
num = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
if s[:a] in num  and  s[a]=='-' and s[a+1:a+b+1] in num:
    print('Yes')
else :
    print('No')
# Judge status: Accepted
S = input()
if S[1] == 'B':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
a = input()
b = input()
c = input()
first_str = a[0]
a = a[1:]
while(1):
  if first_str == 'a':
    if len(a)==0:
      print('A')
      break
    first_str = a[0]
    a = a[1:]
    
  elif first_str == 'b':
    if len(b)==0:
      print('B')
      break
    first_str = b[0]
    b = b[1:]
    
  elif first_str == 'c':
    if len(c)==0:
      print('C')
      break
    first_str = c[0]
    c = c[1:]
# Judge status: Wrong Answer
n = int(input())
x = input().split()
x.sort(reverse=True)
a = 0
b = 0
for i in range(0, n):
  if i % 2 == 0:
    a += int(x[i])
  else:
    b += int(x[i])
print(a - b)
# Judge status: Wrong Answer
n=int(input())
W=[]
ans=0
for i in range(n):
    w=input()
    W.append(w)
    if i>0 and s[len(s)-1]==w[0]:
        ans=1
    if W.count(w)!=1:
        ans=0
        break
    s=w
if ans==0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
# ABC101 C - Minimization
# N <= K + (K-1)(g-1)を満たす最小のgが答え
from math import ceil
N, K = map(int, input().split())
A = list(map(int, input().split()))
g = 1
while True:
    if N <= K + (K-1)*(g-1):
        break
    else:
        g += 1
print(g)
# Judge status: Wrong Answer
A,B,C=map(int,input().split())
if (A==B)and(B==C):
    print("-1")
else:
    count=0
    while True:
        if (A%2==0)and(B%2==0)and(C%2==0):
            a=(B+C)/2
            b=(A+C)/2
            c=(A+B)/2
            A=a
            B=b
            C=c
            count=count+1
        else:
            break
    print(count)
# Judge status: Accepted
n= int(input())
a = list(map(int, input().split()))
a.append(0)
ans=1000
b = 0
for i in range(1,n+1):
  if a[i] < a[i-1]:
    if i-1-b>0:
      ans = ans//a[b]*a[i-1]+ans%a[b]
    b = i
print(ans)
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())

pat = 0
for a in range(A+1):
	for b in range(B+1):
		for c in range(C+1):
			if a*500+b*100+c*50 == X:
				pat += 1
print(pat)
# Judge status: Accepted
a=[int(_) for _ in input().split()]
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float("inf") for _ in range(N)]
for i in range(min(N, K+1)):
  dp[i] = abs(h[i] - h[0])

for j in range(N):
  for k in range(min(N, K+1)):
    if dp[j] > dp[j-k] + abs(h[j] - h[j-k]):
      dp[j] = dp[j-k] + abs(h[j] - h[j-k])
print(dp[N-1])
# Judge status: Accepted
N = int(input())
px = []
py = []
cro1 = []
cro2 = []
for i in range(N):
    x,y = map(int,input().split())
    px.append((x,y))
    py.append((x,y))
    cro1.append(x+y)
    cro2.append(y-x)
"""
px.sort()
py.sort(key=lambda x:x[1])
"""
cro1.sort()
cro2.sort()
print(max(cro1[-1]-cro1[0],cro2[-1]-cro2[0]))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  A[i]=A[i]-i-1
A.sort()
b=A[N//2]
ans=0
for i in range(N):
  ans+=abs(A[i]-b)
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(100):
  for j in range(100):
    if 4*i+7*j == n:
        print('Yes')
        exit(0)
print('No')
# Judge status: Accepted
print(-int(input('Christmas'))%5*' Eve')
# Judge status: Accepted
n, x = map(int, input().split())
xlis = list(map(int, input().split()))
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
d = 0
for i in range(n):
    d = gcd(d, abs(xlis[i]-x))
print(d)
# Judge status: Accepted
N = list(map(int, list(input())))
N.reverse()
N=N+[0]
cnt = 0
for i in range(len(N)):
  n=N[i]
  if n<5:
    cnt+=n
  elif n==5:
    cnt+=n
    if N[i+1]>=5:
      N[i+1]+=1
  else:
    cnt+=10-n
    N[i+1]+=1
print(cnt)
# Judge status: Wrong Answer
ary1 = list(map(int,input().split()))
ary2 = sorted(ary1)
print((ary2[0]*ary2[1])/2)
# Judge status: Wrong Answer
from collections import deque
S = deque(list(input()))
Q = int(input())
f = 0
for _ in range(Q):
  a, *b = input().split()
  f += int(a)
  if a == "2":
    if (int(b[0]) + f) % 2 == 0 :
      S.append(b[1])
    else:
      S.appendleft(b[1])
for i in range(len(S)):
  if f % 2 == 1:
    print (S[-i-1], end="")
  else:
    print (*S, sep="")
# Judge status: Accepted
import sys
import re
import math

# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    a,b,c=ns()
    print(min(c, b//a))


if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
big = 0
small = 0
n = 0
big2 =0
for i in range(len(s)):
  if s[i]=='<':
    big += 1
    n += big
    small =0
    big2 = big
  else:
    small += 1
    n += small
    if small<=big2:
      n-=1
      big =0
print(n)
# Judge status: Accepted
D, S, T = map( int, input().split() )

if D - S * T <= 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = INT()
B = INT()
for i in range(1,4):
  if i != A and i != B:
    print(i)
# Judge status: Wrong Answer
n, c, k = map(int, input().split())
T = sorted([int(input()) for _ in range(n)])

peo = 1
bus = 1
out = T[0] + k

for t in T:
    if t <= out and peo <= c:
        peo += 1
    else:
        out = t + k
        peo = 1
        bus += 1

print(bus)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

ans=0
for i in range(n-a[len(a)-1]):
    for j in range(i+a[i]+1,n):
        if j-i==a[i]+a[j]:
            ans += 1
print(ans)
# Judge status: Accepted
import fractions
A,B = list(map(int,input().split()))
print(A*B//fractions.gcd(A,B))
# Judge status: Wrong Answer
import math
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
k = 0
total = 0
while k != N-1:
    for i in range(k + 1, N-1):
        total += ((xy[i][0] - xy[i+1][0])**2 + (xy[i][1]-xy[i+1][1])**2)**(1/2)
    k += 1
total = total * 2
print(total/N)
# Judge status: Accepted
# B - Buffet

N = int(input())
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]

ans = 0
for i in range(N):
    ans += B[A[i] - 1]
    if i == N - 1:
        break
    if A[i] == A[i + 1] - 1:
        ans += C[A[i] - 1]

print(ans)