#include <iostream>
using namespace std;
int main(){
long long a,b,c,d,e,brkutii=0,ostmqsto;
cin>>a>>b>>c>>d>>e;
    brkutii++;
    ostmqsto=e*e*e-a*a*a;
    if(b*b*b<=ostmqsto){
        ostmqsto=ostmqsto-b*b*b;
        if(c*c*c<=ostmqsto){
            ostmqsto=ostmqsto-c*c*c;
            if(d*d*d<=ostmqsto){
                ostmqsto=ostmqsto-d*d*d;
            }else{
                brkutii++;
            }
        }else{
            brkutii++;
            if(d*d*d>e*e*e-a*a*a-b*b*b){
                if(d*d*d>e*e*e-c*c*c){
                    brkutii++;
                }
            }
        }
    }else{
        brkutii++;
        if(c*c*c<=ostmqsto){
            ostmqsto=ostmqsto-c*c*c;
            if(d*d*d<=ostmqsto){
                ostmqsto=ostmqsto-d*d*d;
            }else{
                if(d*d*d<=e*e*e-b*b*b){
                    brkutii=brkutii;
                }else{
                    brkutii++;
                }
            }
        }else{
            if(c*c*c<=e*e*e-b*b*b){
                ostmqsto=e*e*e-b*b*b-c*c*c;
                if(d*d*d<=ostmqsto){
                    ostmqsto=ostmqsto-d*d*d;
                }else{
                    if(d*d*d<=e*e*e-a*a*a){
                        brkutii=brkutii;
                    }else{
                        brkutii++;
                    }
                }
            }else{
                brkutii++;
                if(d*d*d<=e*e*e-a*a*a || d*d*d<=e*e*e-b*b*b || d*d*d<=e*e*e-c*c*c){
                    brkutii=brkutii;
                }else{
                    brkutii++;
                }
            }
        }
    }
    cout<<brkutii;
return 0;
}
