// Please submit with C++14! It's best to use C++20 or higher version.
#ifndef LOCAL        // Spectre
#pragma region HEAD  // By rbtree (https://rbtree.dev)
#endif
#include <bits/extc++.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <unordered_map>
#include <utility>
#include <vector>
#ifdef ___RB_DEBUG___
#include "rb_debug.h"
#else
#define dbg(...)
#endif
#define ra (scanf("%lld", &la), la)
#define se(exp) exp.begin(), exp.end()
#define fe(arr, exp) for_each(se(arr), exp)
#define LIKELY(exp) __builtin_expect(bool(exp), 1)
#define UNLIKELY(exp) __builtin_expect(bool(exp), 0)

typedef long long tp;
tp la;
using namespace std;
#ifndef LOCAL
#pragma endregion HEAD
#endif

constexpr bool __MTCS__ = 0;

////////////////////////////////////////////////////////////////////////////////

void __Cored__([[maybe_unused]] tp __TID__) {
  tp n = ra, c = ra, tar = 0;
  vector<pair<tp, tp>> a(n);
  for (auto&& [i, j] : a) {
    i = ra;
    j = ra;
  }
  for (stable_sort(a.rbegin(), a.rend());; ++tar) {
    tp t = c;
    tp* x = nullptr;
    for (auto&& [i, j] : a) {
      while (t >= i && j) {
        t -= i;
        --j;
      }
    }
    if (t) {
      for (auto&& [i, j] : a) {
        if (j && i >= t) {
          x = &j;
        }
      }
      if (!x) {
        break;
      }
      --*x;
    }
  }
  printf("%lld
", tar);
}

struct __Initer_t {
  __Initer_t() {
    // freopen("money.in", "r", stdin);
    // freopen("money.out", "w", stdout);
  }
} __Initer;

////////////////////////////////////////////////////////////////////////////////

signed main() {
  static tp __TCS__ = __MTCS__ ? ra : 1, __NOW__ = 0;
  while (__NOW__ < __TCS__) {
    __Cored__(++__NOW__);
  }
  return 0;
}