P10836 [HackerEarth] amit and cookies
普及
题目描述

Amit is very fond of cookies, so he wants to buy some.
There are N different cookies lying in front of him, with their prices, but he has only K Rs.
He wants to maximize the number of cookies he buys with this money.

Now, you are Amit's best friend and have to help him buy as many cookies as possible.

Input Format

The first line contains two integers, N and K, followed by a line containing N space separated integers indicating the cookies' prices.

Output Format

An integer that denotes maximum number of cookies Amit can buy.

Constraints

1 ≤ N ≤ 10^5

1 ≤ K ≤ 10^9

1 ≤ price of any cookie ≤ 10^9

There is only one cookie of each type.

SAMPLE INPUT
5 50
12 81 23 5 29

SAMPLE OUTPUT
3

Explanation

He can buy only 3 cookies at most. These cookies have the following prices: 12,23,5.

输入格式

见题面

输出格式

见题面

样例输入
5 50 12 81 23 5 29 SAMPLE
样例输出
3