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