#include <iostream>
using namespace std;

int main() {

    int A, B, C, D, E, c = 1;
    cin >> A >> B >> C >> D >> E;

    int str1 = E, str2 = E, str3 = E;

    if (A < B) swap(A, B);
    if (B < C) swap(B, C);
    if (A < B) swap(A, B);
    if (C < D) swap(A, B);
    if (B < C) swap(B, C);
    if (A < B) swap(A, B);

    str1 -= A;
    str2 -= A;
    str3 -= A;

    if (str1 < B) {
        c++;
        str1 = E - B;
        str2 = E - B;
        str3 = E - B;
    } else str1 -= B;

    if (str1 == 0) {
        str2 -= B;
        str3 -= B;
    }

    if (str1 < C) {
        if (str2 >= C && str3 >= C) {
            str2 -= C;
        } else {
            c++;
            str1 = E - C;
            str2 = E - C;
            str3 = E - C;
        }
    } else str1 -= C;

    if (str1 == 0) {
        str2 -= C;
        str3 -= C;
    }
    if (str2 == 0) {
        str1 -= C;
        str3 -= C;
    }

    if (str3 < D) c++;

    cout << c;

    return 0;

}
