#include <bits/stdc++.h>
using namespace std;
int Bsearch(vector<int>& v, int l, int r, int key) {
  int m = (l + r) / 2;
  if (l >= r || v[m] == key)
    return m;
  else if (v[m] < key)
    return Bsearch(v, m + 1, r, key);
  else
    return Bsearch(v, l, m - 1, key);
}
int main() {
  int n, i, j, mark;
  cin >> n;
  vector<int> v(n, 0);
  for (i = 0; i < n; i++) {
    for (j = 0; j < 4; j++) {
      cin >> mark;
      v[i] += mark;
    }
  }
  mark = v[0];
  sort(v.begin(), v.end());
  i = Bsearch(v, 0, n - 1, mark);
  for (j = i; j < n; j++)
    if (v[j + 1] != mark) {
      break;
    }
  if (j == n) j--;
  cout << n - j << endl;
  return 0;
}
