#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<ll> a(n), b(n);
    ll first = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
        first += a[i];
    }
    vector<int> p(n);
    iota(p.begin(), p.end(), 0);
    sort(p.begin(), p.end(), [&](int i, int j){
        return (-a[i]-a[i]-b[i]) < (-a[j]-a[j]-b[j]);
    });
    for (int i = 0; i < n; ++i) {
        int x = p[i];
        first += -a[x]-a[x]-b[x];
        if (first < 0) {
            cout << i+1 << '\n';
            return 0;
        }
    }
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <vector>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL) ;cout.tie(NULL)
using namespace std;


#define deb(x) cout << #x << " " << x << endl;
#define ll long long int
#define pb push_back
#define endl "\n"
#define mp make_pair
#define ss second
#define ff first

void online_judge() {

#ifndef ONLINE_JUDGE
	freopen("D:/C++ projects sublime/input/input.txt", "r", stdin);
	freopen("D:/C++ projects sublime/input/output.txt", "w", stdout);
#endif

}

const int N = 2e5 + 5;
int small = INT_MIN;
int large = INT_MAX;

void solve() {
	int n;
	cin >> n;
	vector<pair<double, double>> v;
	for (int i = 0; i < n; i++) {
		double t1, t2;
		cin >> t1 >> t2;
		v.push_back(make_pair(t1, t2));
	}

	int ans = 0;

	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			if (v[j].first != v[i].first) {
				double slope = (v[j].second - v[i].second) / (v[j].first - v[i].first);
				if (slope >= -1 && slope <= 1) {
					ans++;
				}
			}
		}
	}

	cout << ans << endl;

}

int main() {

	fast_cin();
	online_judge();

	ll t;
	t = 1;
	//cin >> t;
	while (t--) {

		solve();


	}




	return 0;
}


