The Birthday Gift
Rohan wants to buy a birthday gift for his best friend. He has a list of potential gifts, each with a specific price. He also has a budget. Rohan can only buy one gift. Help Rohan find out how many gifts he can afford.
You are given the prices of N distinct gifts and Rohan's budget. Count how many gifts Rohan can buy.
Input
The first line contains two integers, N (the number of gifts) and B (Rohan's budget). The second line contains N space-separated integers, representing the prices of the N distinct gifts.
Output
Print a single integer: the number of gifts Rohan can afford.
Constraints
1 <= N <= 1000 1 <= B <= 100000 1 <= price_i <= 100000
Example 1
5 100 20 50 120 80 30
4
There are 5 gifts and the budget is 100. Gifts costing 20, 50, 80, and 30 are affordable. The gift costing 120 is not. So, 4 gifts are affordable.
Example 2
3 50 60 70 80
0
There are 3 gifts and the budget is 50. All gifts cost more than the budget, so 0 gifts are affordable.
Hints
# Read the input from stdin and print the answer.
import sys
def main():
data = sys.stdin.read().split()
# your code here
main()
5 100 20 50 120 80 30
3 50 60 70 80