John Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. After the students of the school took the exams in English, German, Math, and History, a table of results was formed.

There are $n$ students, each of them has a unique id (from $1$ to $n$). Thomas's id is $1$. Every student has four scores correspond to his or her English, German, Math, and History scores. The students are given in order of increasing of their ids.

In the table, the students will be sorted by decreasing the sum of their scores. So, a student with the largest sum will get the first place. If two or more students have the same sum, these students will be sorted by increasing their ids. 

Please help John find out the rank of his son. 


-----Input-----

The first line contains a single integer $n$ ($1 \le n \le 1000$) — the number of students.

Each of the next $n$ lines contains four integers $a_i$, $b_i$, $c_i$, and $d_i$ ($0\leq a_i, b_i, c_i, d_i\leq 100$) — the grades of the $i$-th student on English, German, Math, and History. The id of the $i$-th student is equal to $i$.


-----Output-----

Print the rank of Thomas Smith. Thomas's id is $1$.


-----Examples-----
Input
5
100 98 100 100
100 100 100 100
100 100 99 99
90 99 90 100
100 98 60 99

Output
2

Input
6
100 80 90 99
60 60 60 60
90 60 100 60
60 100 60 80
100 100 0 100
0 0 0 0

Output
1



-----Note-----

In the first sample, the students got total scores: $398$, $400$, $398$, $379$, and $357$. Among the $5$ students, Thomas and the third student have the second highest score, but Thomas has a smaller id, so his rank is $2$.

In the second sample, the students got total scores: $369$, $240$, $310$, $300$, $300$, and $0$. Among the $6$ students, Thomas got the highest score, so his rank is $1$.

Difficulty: competition

Starter code:

Solutions:
def main():
    n = int(input())
    scores = []
    for i in range(n):
        a = list(map(int, input().split()))
        tot = sum(a)
        scores.append((-tot, i))

    scores.sort()
    for i in range(n):
        if scores[i][1] == 0:
            print(i + 1)

main()


n = int(input())
a = [sum(map(int, input().split())) for _ in range(n)]
print(sum(v > a[0] for v in a[1:]) + 1)

n = int(input())

arr = [(0, 0)] * n

for i in range(n):
	a = sum(list(map(int, input().split())))
	arr[i] = (-a, i)
arr.sort()

for i in range(n):
	if arr[i][1] == 0:
		print(i + 1)

n = int(input())
s = []
for i in range(n):
    a, b, c, d = list(map(int, input().split()))
    s.append((-(a + b + c + d), i))
    if i == 0:
        x = -(a + b + c + d)
s.sort()
print(1 + s.index((x, 0)))


n = int(input())

data = []
for i in range(n):
    a = [int(v) for v in input().split()]
    data.append((-sum(a), i))
data.sort()

for j, (_, i) in enumerate(data):
    if i == 0:
        print(j + 1)
        break


n = int(input())
x = []
for i in range(1,n+1):
    l = list(map(int,input().split()))
    x.append([i,sum(l)])
x.sort(key=lambda x:x[1],reverse=True)
c = 0
for i in x:
    c+=1
    if(i[0]==1):
        print(c)
        break

n=int(input())
l=list(map(int,input().strip().split()))
count=1
r=sum(l)
for i in range(n-1):
	l=list(map(int,input().strip().split()))
	r1=sum(l)
	if r1>r:
		count=count+1
print (count)


n = int(input())
a = []
s = sum(list(map(int, input().split())))
ans = 1
for i in range(n - 1):
    x = sum(list(map(int, input().split())))
    if x > s:
        ans += 1

print(ans)


n = int(input())
ans = 1
a, b, c, d = map(int, input().split())
s = a+b+c+d
for i in range(n-1):
    a, b, c, d = map(int, input().split())
    t = a+b+c+d
    if s < t: ans += 1
print(ans)

from sys import stdin
from math import *

line = stdin.readline().rstrip().split()
n = int(line[0])

numbers = list(map(int, stdin.readline().rstrip().split()))

scoreSon = sum(numbers)

numBefore = 0

for i in range(n-1):
    numbers = list(map(int, stdin.readline().rstrip().split()))
    score = sum(numbers)
    if score > scoreSon:
        numBefore+=1
print(numBefore+1)



n=int(input())
x=[]
for i in range(n):
    a=list(map(int,input().split()))
    a.append(i+1)
    x.append(a)
x.sort(key=lambda x:[-sum(x[:4]),x[4]])
for i in range(n):
    if x[i][4]==1:
        print(i+1)
        return

n = int(input())
p = sorted([(-sum(map(int, input().split())), i) for i in range(n)])

for i in range(n):
    if p[i][1] == 0:
        print(i + 1)
        break



def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

n = ii()
a = [(sum(list(map(int, input().split()))), -i) for i in range(n)]
a.sort(reverse=True)

for i in range(n):
    if a[i][1] == 0:
        print(i + 1)

from sys import stdin, stdout
from math import log2

n = int(stdin.readline())
challengers = []

for i in range(n):
    a, b, c, d = map(int, stdin.readline().split())
    challengers.append((-(a + b + c + d), i))

challengers.sort()

for i in range(n):
    if not challengers[i][1]:
        stdout.write(str(i + 1))
        break

n=int(input())
arrx=[]
for i in range(n):
    arr=list(map(int,input().split()))
    arrx.append(sum(arr))
ans=1
for i in range(1,n):
    if(arrx[i]>arrx[0]):
        ans+=1
print(ans)

n = int(input())
thomas = sum(map(int, input().split()))
all = [thomas]
for _ in range(n - 1):
    all.append(sum(map(int, input().split())))
all.sort(reverse=True)
i = all.index(thomas)
print(i + 1)


n = int(input())
c = 0
son = sum(list(map(int, input().split()))) / 4
for i in range(n-1):
    others = sum(list(map(int, input().split()))) / 4
    if son >= others:
        c += 1
print(n-c)

n = int(input())
score = []
son = 0
for i in range(n):
    wk1 = sum([*list(map(int, input().split()))])
    if (i == 0):
        son = wk1
    score.append(wk1)
score.sort(reverse = True)
print(score.index(son) + 1)


students = []
for i in range(int(input())):
  students.append([i, sum(map(int, input().split()))])

students.sort(key=lambda x:(-x[1], x[0]))
for i, student in enumerate(students):
  if student[0] == 0:
    print(i+1)
    break



3

n = int(input())
l = []

for i in range(n):
    a, b, c, d = list(map(int, input().split()))
    l.append((a, b, c, d))

ans = 1
for i in range(1, n):
    if sum(l[i]) > sum(l[0]):
        ans += 1

print(ans)


n = int(input())
j = list(map(int, input().split()))
q = sum(j)
k = 1
for i in range(n - 1):
    x = list(map(int, input().split()))
    y = sum(x)
    if y > q:
        k += 1

print(k)

n = int(input())
u = []
t = 0
for i in range(n):
    u.append(sum(list(map(int, input().split()))))
t = u[0]
u.sort(reverse = 1)
for i in range(n):
    if u[i] == t:
        print(i + 1)
        break


3

def main():
    N = int(input())
    A = []
    for i, _ in enumerate(range(N)):
        a, b, c, d = [int(e) for e in input().split(' ')]
        A.append((-(a + b + c + d), i + 1))

    A.sort()

    for i in range(N):
        if A[i][1] == 1:
            print(i + 1)


def __starting_point():
    main()

__starting_point()

#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        print(*args, **kwargs, file=sys.stderr)
    dprint('debug mode')
except ModuleNotFoundError:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, = getIntList()
zz = []
for i in range(N):
    zx = getIntList()
    zz.append((sum(zx),-i, i+1))

zz.sort(reverse= True)

for i in range(N):
    if zz[i][2] ==1:
        print(i+1)
        break








USE_STDIO = False

if not USE_STDIO:
    try: import mypc
    except: pass

def main():
    n,  = list(map(int, input().split(' ')))
    scores = []
    for id in range(n):
        scores.append((-sum(map(int, input().split(' '))), id))
    scores.sort()
    for rank in range(n):
        if scores[rank][1] == 0:
            print(rank + 1)
            return

def __starting_point():
    main()




__starting_point()