Harryxun/stf_run huggingface dataset:
S = int(input())
l = []
while (S not in l):
  l.append(S)
  if S%2 == 0:
    S //= 2
  else:
    S = 3*S+1
print(len(S)+1)

### FIXED CODE ###

a = int(input())
list1 = [a]
count = 1
while True:
  if a % 2 == 0:
    a = int(a / 2)
    if a in list1:
      count += 1
      break
    list1.append(a)  
  else:
    a = int(a*3 + 1)
    if a in list1:
      count += 1
      break
    list1.append(a)
  count += 1
print(count)
n = int(input())
list_v = map(int,input().split())
list_c = map(int,input().split())

ans = 0
for i in range(n):
  if list_v[i] - list_c[i] > 0:
    ans += list_v[i] - list_c[i]
return(int(ans))

### FIXED CODE ###

n = int(input())
list_v = list(map(int,input().split()))
list_c = list(map(int,input().split()))
 
ans = 0
for i in range(n):
  if list_v[i] - list_c[i] > 0:
    ans += list_v[i] - list_c[i]
print(int(ans))
n = int(input())
p = list(map(int,input().split()))
m=0

for i in range(2,n):
  if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):
    m +=1
  else:
    m +=0

    
print(m)



### FIXED CODE ###

n = int(input())
p = list(map(int,input().split()))
m=0

for i in range(1,n-1):
  if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):
    m +=1
  else:
    m +=0

    
print(m)
import bisect
n,k=map(int,input().split())
l=list(map(int,input().split())) 
g=10**18+10
h=-g
while g-h>1:
    u=(g+h)//2
    ka=0
    for i in range(n):
        hi=bisect.bisect_left(l,u//l[i])
        ka+=hi
        if hi>=i:
            ka-=1
    if ka<=u:
        g=u
    else:
        h=u
print(g)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

p = []
m = []
zero = 0
for i in range(N) :
  if A[i] > 0 :
    p.append(A[i])
  elif A[i] < 0 :
    m.append(-A[i])
  else :
    zero += 1

p.sort()
m.sort()

ng, ok = -(10 ** 18)-1, 10 ** 18+1
while ok - ng > 1 :
  mid = (ok + ng) // 2
  s = 0 
  if mid < 0 :
    j = 0
    for i in range(len(m) - 1, -1, -1) :
      while j < len(p) and m[i] * p[j] < -mid :
        j += 1
      s += len(p) - j
      
  else :
    j = len(p) - 1
    for i in range(len(p)) :
      while j >= 0 and p[i] * p[j] > mid :
        j -= 1
      s += max(0, j - i)
      
    j = len(m) - 1
    for i in range(len(m)) :
      while j >= 0 and m[i] * m[j] > mid :
        j -= 1
      s += max(0, j - i)
      
    s += (len(p) + len(m)) * zero + len(p) * len(m) + zero * (zero - 1) // 2

  if s < K :
    ng = mid
  else :
    ok = mid
    
print(ok)
print(int(input())-int(input()))

### FIXED CODE ###

x,t=map(int,input().split())
print(max(x-t,0))
from collections import defaultdict
def inpl(): return list(map(int,input().split()))

class Counter:
    def __init__(self, start=0):
        self.index = start-1

    def __call__(self):
        self.index += 1
        return self.index

ui = defaultdict(Counter())
xylist = []

H,W,N = inpl()
for i in range(N):
    X, Y = inpl()
    n = ui[X]
    if n < len(xylist):
        xylist[n][1] = min(xylist[n][1],Y)
    else:
        xylist.append([X,Y])

xylist.sort(key=lambda x: x[0])
xylist.append([W+1,1])

# test
if xylist[0][0] == 1:
    xylist = xylist[1:]
if len(xylist) == W:
# and sum([ y for x,y in xylist]) == 2*W -1:
    1/0

# test
ans = 0

Xprev = Yprev = 1
for X, Y in xylist:
    Ybound = Yprev + X - Xprev 
    if Y < Ybound:
        ans = X - 1
        break
    elif Y == Ybound:
        Xprev, Yprev = X, Ybound - 1
    else:
        Xprev, Yprev = X, Ybound

# test
#if Ybound <= 1:
#    1/0

print(ans)

### FIXED CODE ###

from collections import defaultdict
def inpl(): return list(map(int,input().split()))

class Counter:
    def __init__(self, start=0):
        self.index = start-1

    def __call__(self):
        self.index += 1
        return self.index

ui = defaultdict(Counter())
xylist = []

H, W, N = inpl()
for i in range(N):
    X, Y = inpl()
    n = ui[X]
    if n < len(xylist):
        xylist[n][1] = min(xylist[n][1],Y)
    else:
        xylist.append([X,Y])

xylist.sort(key=lambda x: x[0])
xylist.append([H+1,1])

Xprev = Yprev = 1
for X, Y in xylist:
    Ybound = Yprev + X - Xprev 
    if Y < Ybound:
        ans = X - 1
        break
    elif Y == Ybound:
        Xprev, Yprev = X, Ybound - 1
    else:
        Xprev, Yprev = X, Ybound

print(ans)
a,b, k = map(int,input().split())

lis = list(range(a,b+1))


nlis = []
for i in range(a, min(b+1, a+k)):
    nlis.append(i)
    
for j in range(max(b-k+1, a+k), b+1):
    nlis.append(j)
    
for k in sorted(nlis):
    print(k)

### FIXED CODE ###

a,b,k = map(int, input().split())
if k*2+a-1<=b:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n, k = LI()
    ps = LI()
    sum_ = [0]
    for i in range(1, 1000+1):
        sum_.append(sum_[i-1] + i)
    kitai = [ke / (i + 1) for i, ke in enumerate(sum_[1:])]
    kitai2 = [kitai[i-1] for i in ps]
    ans = []
    for i in range(n-k):
        if i == 0:
            ans.append(sum(kitai2[0:0+k]))
        else:
            ans.append(ans[i-1] - kitai2[i-1] + kitai2[i+k-1])
    print(max(ans))



if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n, k = LI()
    ps = LI()
    sum_ = [0]
    for i in range(1, 1000+2):
        sum_.append(sum_[i-1] + i)
    kitai = [ke / (i + 1) for i, ke in enumerate(sum_[1:])]
    kitai2 = [kitai[i-1] for i in ps]
    ans = []
    for i in range(n-k+1):
        if i == 0:
            ans.append(sum(kitai2[0:k]))
        else:
            ans.append(ans[i-1] - kitai2[i-1] + kitai2[i+k-1])
    print(max(ans))




if __name__ == '__main__':
    main()
a,b,c = map(int,input())
if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)

### FIXED CODE ###

a,b,c = map(int,input().split())
if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
n,m=map(int,input().split())
uf=UnionFind(n)
for i in range(m):
  a,b=map(int,input().split())
  uf.union(a,b)
print(uf.group_count()-1)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
n,m=map(int,input().split())
uf=UnionFind(n)
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  uf.union(a,b)
print(uf.group_count()-1)
s = int(''.join(input.split('/')))
if(s <= 20190430):print('Heisei')
else:print('TBD')

### FIXED CODE ###

s = int(''.join(input().split('/')))
if(s <= 20190430):print('Heisei')
else:print('TBD')
S = input().strip()
while len(S) > 0:
  S = S[:-1]
  mid = len(S)//2
  if S[:mid] == S[mid:]:
    print(len(S))
  	break
  

### FIXED CODE ###

S = input().strip()
while len(S) > 0:
  S = S[:-1]
  mid = len(S)//2
  if S[:mid] == S[mid:]:
    print(len(S))
    break
W,H,x,y = map(int, input().split())
if x == int(W/2) and y == int(H/2):
  print(int((W*H)/2) + " " + "1")
else:
  print(int((W*H)/2) + " " + "0")

### FIXED CODE ###

W,H,x,y = map(int, input().split())
if int(x + x) == W and int(y + y) == H:
  print(str((W*H)/2) + " " + "1")
else:
  print(str((W*H)/2) + " " + "0")
a, b= [int(input()) for _ in range(2)]
import math
c=math.sqrt(a*(10**len(str(b)))+b)
if int(c) == c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from math import sqrt
a, b = input().split()
n = int(a+b)
if(int(sqrt(n))**2 == n):
    print("Yes")
else:
    print("No")
from math import gcd


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


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

cnt_b = b // c + b // d - b // lcm(c, d)
cnt_a = (a - 1) // c + (a - 1) // d - (a - 1) // lcm(c, d)

print(b - a + 1 - (cnt_b - cnt_a))



### FIXED CODE ###

from fractions import gcd


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


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

cnt_b = b // c + b // d - b // lcm(c, d)
cnt_a = (a - 1) // c + (a - 1) // d - (a - 1) // lcm(c, d)

print(b - a + 1 - (cnt_b - cnt_a))
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])

        	ans += c - 1 - b
print(ans)

### FIXED CODE ###

# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
import math
# mod = 10**9 + 7

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


print(a-2*b if a-2*b>=0 else 0)
from collections import Counter



N = int(input())
points = [tuple(map(int, input().split())) for _ in range(N)]
vecs = {}
counter = Counter()

for i, a in enumerate(points):
    for j in range(N):
        if j == i:
            continue
        b = points[j]
        dx = b[0] - a[0]
        dy = b[1] - a[1]
        vecs[(i, j)] = (dx, dy)
        counter[(dx, dy)] += 1

vec, _ = counter.most_common()[0]
dx, dy = vec
visited = set()
cost = 0

for i, p in enumerate(points):
    if i in visited:
        continue
    x, y = p
    if (x + dx, y + dy) in visited or (x - dx, y - dy) in visited:
        continue
    cost += 1
    visited.add(p)

print(cost)


### FIXED CODE ###

from collections import Counter


def main():
    N = int(input())
    points = [tuple(map(int, input().split())) for _ in range(N)]
    counter = Counter()

    if N == 1:
        print(1)
        return

    for i in range(N):
        for j in range(N):
            if j == i:
                continue
            a = points[i]
            b = points[j]
            dx = b[0] - a[0]
            dy = b[1] - a[1]
            counter[(dx, dy)] += 1

    vec, _ = counter.most_common()[0]
    dx, dy = vec
    visited = set()
    pointset = set(points)
    cost = 0

    for p in points:
        if p in visited:
            continue
        visited.add(p)
        x, y = p
        cost += 1

        i = 1
        while True:
            n = (x + i * dx, y + i * dy)
            i += 1
            if n in pointset:
                visited.add(n)
            else:
                break
        i = 1
        while True:
            n = (x - i * dx, y - i * dy)
            i += 1
            if n in pointset:
                visited.add(n)
            else:
                break

    print(cost)


main()
import math
x, y = map(int, input())
print((x * y) // math.gcd(x, y))

### FIXED CODE ###

from fractions import gcd
x, y = map(int, input().split())
print((x * y) // gcd(x, y))
N,D =map(int, input().split())
    all_list = [list(map(int, input().split())) for i in range(N)]
    #>>>4
    count = 0
    for n in range (N):
        for nn in range(N):
            distance = 0
            for d in range(D):
                kou = (all_list[n][d] - all_list[nn][d])**2
                distance += kou
            for s in range(250):
                if distance == s**2:
                    count += 1
                    break
    print(round((count - N) / 2) +)

### FIXED CODE ###

N,D =map(int, input().split())
all_list = [list(map(int, input().split())) for i in range(N)]
#>>>4
count = 0
for n in range (N):
    for nn in range(n):
        distance = 0
        for d in range(D):
            kou = (all_list[n][d] - all_list[nn][d])**2
            distance += kou
        for s in range(250):
            if distance == s**2:
                count += 1
                break
print(count)
import sys
a,b,c,d=int,input().split()
if a+b+c+d==7:
  print('a+b+c+d=7')
  sys.exit()
if a+b+c-d==7:
  print('a+b+c-d=7')
  sys.exit()
if a+b-c+d==7:
  print('a+b-c+d=7')
  sys.exit()      
if a-b+c+d==7:
  print('a-b+c+d=7')
  sys.exit()
if a+b-c-d==7:
  print('a+b-c-d=7')
  sys.exit()
if a-b-c+d==7:
  print('a-b-c+d=7')
  sys.exit()
if a-b+c-d==7:
  print('a-b+c-d=7')
  sys.exit()
if a-b-c-d==7:
  print('a-b-c-d=7')
  sys.exit()


### FIXED CODE ###

import sys
S=input()
a,b,c,d=S[0],S[1],S[2],S[3]
lst=['+','-']
for i in lst:
  for j in lst:
    for k in lst:
      if eval(a+i+b+j+c+k+d+'==7'):
        print(a+i+b+j+c+k+d+'=7')
        sys.exit()
b = int(input())

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

co = 0
s = 0
ss = 0

for i in range(len(a)):
  while a[i] % 2 == 0:
    co += 1
    a[i] //= 2
  if co == 1:
    s += 1
  elif co >= 2:
    ss += 1
  
b -= s

if b % 2 == 1 && s > 0:
  b += 1
elif b % 2 == 1 && s == 0:
  b -= 1
b //= 2

if ss >= b:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

b = int(input())

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

co = 0
s = 0
ss = 0

for i in range(len(a)):
  while a[i] % 2 == 0:
    co += 1
    a[i] //= 2
  if co == 1:
    s += 1
  elif co >= 2:
    ss += 1
  co = 0
  
b -= s

if b % 2 == 1 and s > 0:
  b += 1
elif b % 2 == 1 and s == 0:
  b -= 1
b //= 2

if ss >= b:
  print("Yes")
else:
  print("No")
N, L, T = list(map(int, input().split()))

X = []
W = []
X_after = []
for _ in range(N):
    x, w = list(map(int, input().split()))
    if w == 1:
        x_after = (x + T) % L
    else:
        x_after = (x - T) % L
        x_after = x_after if x_after >= 0 else L + x_after
    X.append(x)
    W.append(w)
    X_after.append(x_after)

n_colide = 0
for i in range(1, N):
    if W[0] == 1 and W[i] == 2:
        dist = X[i] - X[0]
        n_colide += 2 * (T - (dist / 2)) // L + 1
    elif W[0] == 2 and W[i] == 1:
        dist = (L + X[0]) - X[i]
        n_colide += 2 * (T - (dist / 2)) // L + 1

if W[0] == 1:
    num_after = n_colide % N
else:
    num_after = N - (n_colide % N)

num_after = int(num_after)

x_after_first = X_after[0]
X_after = sorted(X_after)
i = X_after.index(x_after_first)
X_after = X_after[i-num_after:] + X_after[:i-num_after]

for x_after in X_after:
    print(x_after)


### FIXED CODE ###

import math

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

num_split = 1
sign = None
len_A_list = len(A_list)

for i in range(len_A_list-1):
    if sign == None:
        if A_list[i+1] - A_list[i] == 0:
            continue
        sign = (A_list[i+1] - A_list[i]) / math.fabs(A_list[i+1] - A_list[i])

    if (A_list[i+1] - A_list[i]) *  sign >= 0:
        continue

    num_split += 1
    sign = None

print(num_split)
import math

def main():
    n, m = list(map(int, input().split()))
    print((n * m) // math.gcd(n, m))


if __name__ == '__main__':
    main()

### FIXED CODE ###

import fractions


def main():
    n, m = list(map(int, input().split()))
    print((n * m) // fractions.gcd(n, m))


if __name__ == '__main__':
    main()
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

k = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])

cnt = (k-a) // (a-b)

if ((k-a) % (a-b) == 0):
    
    val=1 + cnt * 2
    
else:
    
    val=1 + (cnt + 1) * 2
    
print(val if val>=0 else -1)

### FIXED CODE ###

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

k = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])

cnt = a - b

rate = a

if rate >= k:
    
    print(1)
    
elif cnt==0:

    print(-1)
else:
    
    if (k-rate) % cnt == 0:
        
        num = (k-rate) // cnt 
        
        print(1+ num*2)
    
    else:
        
        num = ((k-rate) // cnt) + 1
        
        if num>=1 :
        
            print(num*2+1)
        
        else:
            
            print(-1)
a,b=map(str().input())
if a>b:
  print(">")
elif a==b:
  print("=")
else:
  print("<")

### FIXED CODE ###

a,b=map(str,input().split())
if a>b:
  print(">")
elif a==b:
  print("=")
else:
  print("<")
N, M = int(input().split())
A = input.split()
total = 0
for i in range(A):
    total = total+A[i]

if total <= N:
    print (N - total)
else:
    print ("-1")


### FIXED CODE ###

import math

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

if (n-sum(a)) < 0:
    print(-1)
else:
    print(n-sum(a))
dat =list(input().split())

for i in dat:
   i = int(i)

dat.sort()
dat.reverse()

asum = 0
bsum = 0

length = len(dat)

for i in range(length):
#	if i%2==0:
#		asum = asum + dat[i]
#	else:
#		bsum = bsum + dat[i]
		
print(asum-bsum)

### FIXED CODE ###

n = int(input())
dat = list(input().split())

dat = list(map(int,dat))

dat.sort(reverse=True)

asum = 0
bsum = 0

for i in range(n):
	if i % 2 == 0:
		asum = asum + dat[i]
	else:
		bsum = bsum + dat[i]
		
print(asum-bsum)
n = int(input())
ans = 0
for i in range(1, n + 1):
    if 10 <= i < 100 or 1000 <= i < 10000 or i == 100000:
        continue
    else:
        ans += 1
print(ans)

### FIXED CODE ###

a, b, c = map(int,input().split())
print(b + c - a if b + c - a > 0 else 0)
def resolve():
    S = list(input())
    if len(S) == 2:
        print(-1, -1)    
    for i in range(len(S)-3):
        if S[i] == S[i+1] or S[i+1] == S[i+2] or S[i+2] == S[i]):
            print(i+1, i+3)
            return
    print(-1, -1)


if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    S = list(input())
    if len(S) == 2:
        if S[0] == S[1]:
            print(1, 2)
        else:
            print(-1, -1)
        return
    for i in range(len(S)-2):
        if S[i] == S[i+1] or S[i+1] == S[i+2] or S[i+2] == S[i]:
            print(i+1, i+3)
            return
    print(-1, -1)


if __name__ == '__main__':
    resolve()
S=input()
T=input()
from collections import Counter
s=list(S)
t=list(T)
a=Counter(s)
b=Counter(t)
c=a.most_common()
d=b.most_common()
flag=True
for i in range(len(s)):
    if d[i][1]==1 and c[i][1]==1:
        break
    if d[i][1]>=2 and flag:
        e=[]
        for j in range(len(s)):
            if t[j]==d[i][0]:
                e.append(s[j])
        for j in range(len(e)-1):
            if e[j]!=e[j+1]:
                flag=False
                break
    if c[i][1]>=2 and flag:
        f=[]
        for j in range(len(s)):
            if s[j]==c[i][0]:
                f.append(t[j])
        print(f)
        for j in range(len(f)-1):
            if f[j]!=f[j+1]:
                flag=False
                break
if flag:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

from collections import Counter
S=input()
T=input()
s=list(S)
t=list(T)
a=Counter(s)
b=Counter(t)
c=a.most_common()
d=b.most_common()
flag=True
for i in range(min(len(d),len(c))):
    if d[i][1]==1 and c[i][1]==1:
        break
    if d[i][1]>=2 and flag:
        e=[]
        for j in range(len(s)):
            if t[j]==d[i][0]:
                e.append(s[j])
        for j in range(len(e)-1):
            if e[j]!=e[j+1]:
                flag=False
                break
    if c[i][1]>=2 and flag:
        f=[]
        for j in range(len(s)):
            if s[j]==c[i][0]:
                f.append(t[j])
        for j in range(len(f)-1):
            if f[j]!=f[j+1]:
                flag=False
                break
if flag:
    print('Yes')
else:
    print('No')
A = list(map(int, input().split()))
print('bust' if sum(a) >= 22 else 'win')

### FIXED CODE ###

a = list(map(int, input().split()))
print('bust' if sum(a) >= 22 else 'win')
import math
import os
import random
import re
import sys

def solution(s,t):
    if(s[-1]==t[-1]):
        return "No"
    return "Yes"
if __name__ == '__main__':
    fptr = sys.stdout

        s=input()
        t=input()

        result = solution(s,t)

        fptr.write(str(result) + '\n')

    fptr.close()


### FIXED CODE ###

import sys 
s=input()
t=input()
l=list()
for i in "abcdefghijklmnopqrstuvwxyz":
    l.append(s+""+i)
if(t in l):
    print("Yes")
else:
    print("No")
#coding:UTF-8

a = input()
b = input()
c = input()

if a*c <= b:
	print('高橋くんは' + a*c + '円以上持っているのでお気に入りの音を' + c + '回聞いて満足します。')
 	print(c)
    
else:
  	print('高橋くんが満足できないこともあります。')
    print('b/a')

### FIXED CODE ###

a,b,c = map(int,input().split())
num = int(b/a)

if num > c:
	print(c)

else:
	print(num)
#coding: utf-8
import numpy as np
N, M = map(int, input().split())
AB = np.array([list(map(int, input().split())) for _ in range(N)])
money = 0
col_num = 0
AB = AB[np.argsort(AB[:, col_num])]
if M <= AB[np.argmin(AB[:, 0]), 1]:
    money += AB[0, 0] * M
else:
    i = 0
    while M >= 0:
        money += AB[i, 0] * AB[i, 1]
        M -= AB[i, 1]
        if M < 0:
          money += AB[i, 0] * M
        i += 1
print(money)

### FIXED CODE ###

#coding: utf-8
import numpy as np
N, M = map(int, input().split())
AB = np.array([list(map(int, input().split())) for _ in range(N)])
money = 0
col_num = 0
AB = AB[np.argsort(AB[:, col_num])]
if M <= AB[np.argmin(AB[:, 0]), 1]:
    money += AB[0, 0] * M
else:
    i = 0
    while M > 0:
        money += AB[i, 0] * AB[i, 1]
        M -= AB[i, 1]
        if M <= 0:
          money += AB[i, 0] * M
        i += 1
print(money)