#include <iostream>
using namespace std;
int main()
{
    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;
    if(A<1 or B<1 or C<1 or D<1 or E<1 or A>1000 or B>1000 or C>1000 or D>1000 or E>1000)
    {
        cout << "Izvun ogranicheniata sa vuvedenite danni" << endl;
    }else{
    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;
}#include <iostream>
using namespace std;
int main()
{
    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;
    if(A<1 or B<1 or C<1 or D<1 or E<1 or A>1000 or B>1000 or C>1000 or D>1000 or E>1000)
    {
        cout << "Izvun ogranicheniata sa vuvedenite danni" << endl;
    }else{
    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;
}#include <iostream>
using namespace std;
int main()
{
    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;
    if(A<1 or B<1 or C<1 or D<1 or E<1 or A>1000 or B>1000 or C>1000 or D>1000 or E>1000)
    {
        cout << "Izvun ogranicheniata sa vuvedenite danni" << endl;
    }else{
    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;
}#include <iostream>
using namespace std;
int main()
{
    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;
    if(A<1 or B<1 or C<1 or D<1 or E<1 or A>1000 or B>1000 or C>1000 or D>1000 or E>1000)
    {
        cout << "Izvun ogranicheniata sa vuvedenite danni" << endl;
    }else{
    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;
}