#include<iostream>
using namespace std;
int main()
{
    unsigned long long a, b, c, d, e, va, vb, vc, vd, ve, r = 0, sum;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    cin>>e;
    va = a*a*a;
    vb = b*b*b;
    vc = c*c*c;
    vd = d*d*d;
    ve = e*e*e;
    if(va+vb<ve)
    {
        r++;
        if(va+vb+vc<ve)
        {
            if(va+vb+vc+vd<ve)
            {
                r = 1;
            }
            else
            {
                r = 2;
            }
        }
        else
        {
            if(vc+vd<ve)
            {
                r = 2;
            }
            else
            {
                r = 3;
            }
        }
    }
    else
    {
        r = 4;
    }
    cout<<r;
    return 0;
}
