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