import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

alias sread = () => readln.chomp();
ulong MOD = 1_000_000_007;
ulong INF = 1_000_000_000_000;
alias Katana = Tuple!(long, "swing", long, "throwing");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void main()
{
    long n, h;
    scan(n, h);
    auto k = new Katana[](n);
    long throw_sum;
    foreach (i; iota(n))
    {
        long a, b;
        scan(a, b);
        k[i] = Katana(a, b);
        throw_sum += k[i].throwing;
    }

    long cnt1 = INF, cnt2 = INF;
    if (h <= throw_sum)
    {
        k.sort!"a.throwing > b.throwing"();
        cnt1 = 0;
        auto tmp = h;
        while (tmp > 0)
            tmp -= k[cnt1++].throwing;
    }

    k.sort!"a.swing < b.swing"();
    cnt2 = 0;
    foreach (i; iota(n - 1))
    {
        if (k[i].throwing > k[$ - 1].swing)
        {
            h -= k[i].throwing;
            cnt2++;
        }
    }

    while (h > k[$ - 1].throwing)
    {
        h -= k[$ - 1].swing;
        cnt2++;
    }

    if (h)
        writeln(min(cnt1, cnt2 + 1));
    else
        writeln(min(cnt1, cnt2));
}
