#include <iostream>
using namespace std;
int main()
{
    long long strani[4],E,b=0,a=1;
    for (int j=0; j<4; j++)
    {
        cin>>strani[j];
    }
    cin>>E;

    if ( ( strani[2]+strani[3] ) <= E )
    {
        cout<<"1"<<endl;
        a=0;
    }

    for (int j=3; j>=0; j--)
    {
        if (strani[j]==E)
        {


        b++;
        a=1;
    }
    }


    if (a!=0){
    cout<<b<<endl;
    }

    return 0;
}
