
#include <ostream>
using namespace std;

int main ()
{
    int E, A, B, C, D, p;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    cin >> E;
    if (A == B && A == C && A == D && A == E &&B == A && B == C && B == D && B == E && C == A && C == B && C == D && C == E; )
    {
        p = 4;
    }
    if (E * E > A * A + B * B + C * C + D * D)
    {
        p = 1;
    }

    if (E * E > A * A + B * B and E * E > C * C + D * D and E * E < A * A + B * B + C * C and E * E < A * A + B * B + D *D)
    {
        p = 2;
    }

    if (E * E > A * A + C * C and E * E > B * B  + D * D and E * E < A * A + D * D + C * C and E * E < A * A + B * B + C *C)
    {
        p = 2;
    }

    if (E * E > A * A + D * D and E * E > B * B  + C * C and E * E < A * A + D * D + C * C and E * E < A * A + B * B + D * D)
    {
        p = 2;
    }

    if (E * E > B * B + C * C and E * E > A * A + D * D && E * E < B * B + C * C + A * A and E * E > B * B + C * C + D * D)
    {
        p = 2;
    }

    if (E * E > B * B + D * D and E * E > A * A + C * C&& E * E < B * B + D * D + A * A and E * E > B * B + C * C + D * D)
    {
        p = 2;
    }

    if (E * E > C * C + D * D && E * E > A * A + B * B && E * E < C * C + D * D + B * B && E * E < C * C + D * D + A * A)
    {
        p = 2;
    }



    if (E * E > A * A + B * B and E * E < B * B + A * A + C * C and E * E < A * A + B * B + D * D and E * E < C * C +  D *D)
    {
        p = 3;
    }

    if (E * E > A * A +C * C and E * E < B * B + A * A + C * C and E * E < A * A + C * C + D * D and E * E < B * B +  D *D)
    {
        p = 3;
    }

    if (E * E > A * A +D * D and E * E < B * B + A * A + D * D and E * E < A * A + C * C + D * D and E * E < B * B +  C *C)
    {
        p = 3;
    }

    if (E * E > B * B + C * C and E * E < B * B + C * C + D * D and E * E < B * B + C * C + A * A and E * E < A * A +  D * D)
    {
        p = 3;
    }
    if (E * E > B * B + D * D and E * E < B * B + C * C + D * D and E * E < B * B + D * D + A * A and E * E < A * A +  C * C)
    {

        p = 3;
    }
    if (E * E < C * C + D * D and E * E < C * C + D * D + A * A && E * E < C * C + D * D + B * B && E * E < A * A + B * B )
    {
        p = 3;
    }

    cout << p;

    return 0;