#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int ans = 0;
  int score = -1;
  for (int i = 0; i < n; i++) {
    int sub, subsc = 0;
    scanf("%d", &sub);
    subsc += sub;
    scanf("%d", &sub);
    subsc += sub;
    scanf("%d", &sub);
    subsc += sub;
    scanf("%d", &sub);
    subsc += sub;
    if (subsc > score) {
      ans++;
    }
    if (!i) score = subsc;
  }
  printf("%d", ans);
  return 0;
}
