output_description: Print the maximum possible number of happy children.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N x
      a_1 a_2 ... a_N
attempt: # child_count = 3
  # candy_sum = 70
  # requirement_list = [20, 30, 10]
  N = 2  # 入力は2行
  # for i in range(N):
  #     line = input()
  #     print(type(line)) # str
  #     print(line) # 1行目だけ
  for i in range(N):
      line = input()  # 入力を1行受け取る
      if i == 0:  # 1行目
          child_count, candy_sum = map(int, line.split())
      else:  # 2行目
          requirement_list = list(map(int, line.split()))
  # print(child_count, candy_sum, requirement_list)
  satisfied_count = 0
  requirement_list.sort()  # 昇順に並び替え
  requirement_list.reverse()  # 降順に並び替え
  # print(requirement_list)
  # 最後の人を考慮漏れ
  for i in range(child_count):  # len(requirement_list) == child_count
      requirement = requirement_list[i]
      # print(i, candy_sum, requirement)
      if i == child_count - 1:  # 最後の人(残りのお菓子がほしい数と一致するか)
          if requirement == candy_sum:
              satisfied_count += 1
      else:  # 1人目からchild_count-1人目まで
          if requirement <= candy_sum:
              candy_sum -= requirement
              satisfied_count += 1
  # for requirement in requirement_list:
  #     if requirement <= candy_sum:
  #         candy_sum -= requirement
  #         satisfied_count += 1
  #         print(requirement, candy_sum)
  #     # requirement > candy_sumのときは何もしない。
  #     # candy_sum = 20のケースがあるので、
  #     # [30, 20, 10]のときに最初が30だからといってbreakもしない
  print(satisfied_count)
  
problem_description: Statement
  
  There are N children, numbered 1, 2, ..., N.
  
  Snuke has decided to distribute x sweets among them. He needs to give out all
  the x sweets, but some of the children may get zero sweets.
  
  For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly
  a_i sweets. Snuke is trying to maximize the number of happy children by
  optimally distributing the sweets. Find the maximum possible number of happy
  children.
samples: [{"input": "3 70\n    20 30 10", "output": "2\n    \n\nOne optimal way to distribute sweets is (20, 30, 20).\n\n* * *"}, {"input": "3 10\n    20 30 10", "output": "1\n    \n\nThe optimal way to distribute sweets is (0, 0, 10).\n\n* * *"}, {"input": "4 1111\n    1 10 100 1000", "output": "4\n    \n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\n* * *"}, {"input": "2 10\n    20 20", "output": "0\n    \n\nNo children will be happy, no matter how the sweets are distributed."}]