#include<iostream>
using namespace std;
int main()
{
    unsigned long long a, b, c, d, e, de, dc, db, r = 1;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    cin>>e;
    de = e-d;
    if(c<=de)
    {
        r = 1;
    }
    else
    {
        dc = e-c;
        if(b<=de)
        {
            r = 2;
        }
        else
        {
            if(b<=dc)
            {
                if(a<=de)
                {
                    r = 2;
                }
                else
                {
                    if(a<=dc)
                    {
                        r = 2;
                    }
                }
            }
            else
            {
                db = e-b;
                if(a<=db)
                {
                    r = 3;
                }
                else
                {
                    r = 4;
                }
            }
        }
    }
    cout<<r;
    return 0;
}
