import algorithm, math, sequtils, strutils let m = (stdin.readLine.split)[1].parseInt var xs = stdin.readLine.split.map parseInt sort xs cumsum xs var ans = 0 for i, v in xs: if v > m: break ans = succ i echo ans