#include <iostream>
using namespace std;
int main()
{
    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;
    if(E*E*E>=A*A*A+B*B*B+C*C*C+D*D*D)
    {
        cout << "1" << endl;
    }else
    {
        if(E*E*E>=A*A*A+B*B*B+C*C*C)
        {
            cout << "2" << endl;
        }else
        {
            if(E*E*E>=A*A*A+B*B*B)
               {
                   cout << 3 << endl;
               }else
               {
                          cout << 4 << endl;
               }
        }
    }
    return 0;
}
