#include <iostream>
using namespace std;

int main ()
{
    int L,n,m,sum=0,br=0;
    cin>>L>>m>>n;
    while ( L<sum)
    {
        cin>>L>>m>>n;
        m=n+m;
        sum=sum+m;
        br++;
        cout<<br;
        return 0;
    }
    return 0;
}
