using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;

namespace Atcoder {
    class Program {
        static void Main(string[] args) {
            var N = Input.IntArr;
            var intList = new List<int>();
            for (int h = 0; h < N.First(); h++) {
                intList.Add(Input.Int);
            }
            var sum = N.Last();
            intList = intList.OrderBy(h => h).ToList();
            sum -= intList.Sum();

            int i = 0;
            int counter = 0;
            while (sum >= 0) {
                sum -= intList[0];
                if (i == intList.Count())
                    i %= intList.Count();
                counter++;
            }


            Console.WriteLine(intList.Count() + counter -1);
            return;
        }

        static long max(long left, long right) {
            if (left >= right)
                return left;
            return right;
        }

        static long min(long left, long right) {
            if (left >= right)
                return right;
            return left;
        }

        static long Kumiawase(int n, int r) {
            return Getkaijo(n) / (Getkaijo(n - r) * Getkaijo(r));

        }

        static long Getkaijo(int n) {
            if (n == 1)
                return n;
            return n * Getkaijo(n - 1);
        }
    }

    public static class Input {
        public static string Str => Console.ReadLine().Trim();
        public static int Int => int.Parse(Str);
        public static long Long => long.Parse(Str);
        public static double Double => double.Parse(Str);

        public static string[] StrArr => Str.Split(new[] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries).ToArray();
        public static int[] IntArr => StrArr.Select(int.Parse).ToArray();
        public static double[] DoubleArr => StrArr.Select(double.Parse).ToArray();
        public static long[] LongArr => StrArr.Select(long.Parse).ToArray();

        public static List<string> StrList => Str.Split(new[] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries).ToList();
        public static List<int> IntList => StrArr.Select(int.Parse).ToList();
        public static List<double> DoubleList => StrArr.Select(double.Parse).ToList();
        public static List<long> LongList => StrArr.Select(long.Parse).ToList();

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                            : eq<T, long>() ? ct<T, long>(long.Parse(s))
                            : eq<T, double>() ? ct<T, double>(double.Parse(s))
                            : eq<T, char>() ? ct<T, char>(s[0])
                                              : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(Str);
        static void Multi<T, U>(out T a, out U b) {
            var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c) {
            var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }

        static void Multi<T, U, V, W>(out T a, out U b, out V c, out W d) {
            var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]);
        }
    }
}


Measured memory_bytes: 13524