qtd = int(input())
qtdn = int(input())
qtdx = int(input())
qtd = qtd + qtdn - qtdx
semana = 0
while(qtd<200 and qtd>0):
	semana = semana +1
	qtdn = int(input())
	qtdx = int(input())
	qtd = qtd + qtdn - qtdx
	semana = semana + 1
	
	
print(semana)
	
