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

