#!/usr/bin/env python
import sys
sys.setrecursionlimit(100000000)

n, m = list(map(int, input().split()))
c = list(map(int, input().split()))
DP = {}

# num 番目までのコインを使い、yen 円支払うときに必要な枚数
def func(num, yen):
	if num < 0 or yen < 0:
		return 10 ** 18
	if num == 0 and yen == 0:
		return 0
	if not (num, yen) in DP:
		DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1)
	return DP[(num, yen)]

print(func(m - 1, n))
 import sys sys sys.setrecursionlimit(100000000) sys.setrecursionlimit sys setrecursionlimit 100000000 n, m = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m c = list(map(int, input().split())) c list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split DP = {} DP {} def func(num, yen):
	if num < 0 or yen < 0:
		return 10 ** 18
	if num == 0 and yen == 0:
		return 0
	if not (num, yen) in DP:
		DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1)
	return DP[(num, yen)] func if num < 0 or yen < 0:
		return 10 ** 18
	 num < 0 or yen < 0 num < 0 num 0 yen < 0 yen 0 return 10 ** 18 10 ** 18 10 18 if num == 0 and yen == 0:
		return 0
	 num == 0 and yen == 0 num == 0 num 0 yen == 0 yen 0 return 0 0 if not (num, yen) in DP:
		DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1)
	 not (num, yen) in DP (num, yen) in DP (num, yen) num yen DP DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1) DP[(num, yen)] DP (num, yen) num yen min(func(num - 1, yen), func(num, yen - c[num]) + 1) min func(num - 1, yen) func num - 1 num 1 yen func(num, yen - c[num]) + 1 func(num, yen - c[num]) func num yen - c[num] yen c[num] c num 1 return DP[(num, yen)] DP[(num, yen)] DP (num, yen) num yen num num yen yen print(func(m - 1, n)) print func(m - 1, n) func m - 1 m 1 n c = list(map(int, input().split())) list(map(int, input().split())) c m = list(map(int, input().split())) list(map(int, input().split())) m DP = {} {} DP n, m = list(map(int, input().split())) list(map(int, input().split())) n def func(num, yen):
	if num < 0 or yen < 0:
		return 10 ** 18
	if num == 0 and yen == 0:
		return 0
	if not (num, yen) in DP:
		DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1)
	return DP[(num, yen)] def func(num, yen):
	if num < 0 or yen < 0:
		return 10 ** 18
	if num == 0 and yen == 0:
		return 0
	if not (num, yen) in DP:
		DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1)
	return DP[(num, yen)] func
#!/usr/bin/env python
import sys
sys.setrecursionlimit(100000000)

n, m = list(map(int, input().split()))
c = list(map(int, input().split()))
DP = {}

# num 番目までのコインを使い、yen 円支払うときに必要な枚数
def func(num, yen):
	if num < 0 or yen < 0:
		return 10 ** 18
	if num == 0 and yen == 0:
		return 0
	if not (num, yen) in DP:
		DP[(num, yen)] = min(func(num - 1, yen), func(num, yen - c[num]) + 1)
	return DP[(num, yen)]

print(func(m - 1, n))

