public void solve() throws IOException {
    int n = nextInt();
    long t = nextLong();

    Cow[] cows = new Cow[n];
    for (int x = 0; x < n; x++) {
      cows[x] = new Cow(nextInt(), nextInt());
    }

    List<MutableLong> lanes = new ArrayList<MutableLong>(n);
    for (int x = n - 1; x >= 0; x--) {
      MutableLong end = new MutableLong(cows[x].pos + cows[x].speed * t);
      if (lanes.size() == 0 || lanes.get(lanes.size() - 1).val <= end.val) {
        lanes.add(end);
      } else {
        int index = Collections.binarySearch(lanes, end);
        if (index < 0) {
          index = -1 * (index + 1);
        } else {
          while (lanes.get(index).val == end.val) {
            index++;
          }
        }
        lanes.get(index).setVal(end.val);
      }
    }
    
    out.println(lanes.size());
  }