#include<iostream>
using namespace std;
int main ()
{
long long a, b, c, d, e, o, o2;
cin>>a>>b>>c>>d>>e;
    o=a*a*a+b*b*b+c*c*c+d*d*d;
    o2=e*e*e;

    if(o%o2==0&&(a+b+c+d)*3<=e*12*o/o2)
    {
        cout<<o/o2;
    }
    else
    {
        cout<<o/o2+o%o2;
    }
    return 0;
}
