#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                                #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                    		return x != p.x ? x<p.x: y<p.y;
                                    	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };
int x[60]={0};

vector<int> wa,sa;

int p[100][100];
map<int,int> ma;

int n,k;
vector<int> sosu,yakusu,kosu;


int wareru(int r){
	if(k%r!=0) return 0;
	
	int sai=(n/r)*r;
	
	sai=((r+sai)*(sai/r)/2)%inf;
	
	//cout<<"r "<<r<<" "<<sai<<endl;
	return sai;
}

vector<pas> ve;
int dp[60][60][60][2];
           signed main(){
    int q,h,s,d;
           	cin>>q>>h>>s>>d;
     //      	q*=4;
       //    	h*=4;
         //  	s*=4;
           //	d*=4;
           	int n;
           	cin>>n;
           	n*=4;
           	
           		ve.pb({q*8,1});
           	ve.pb({h*4,2});
           	ve.pb({s*2,4});
           	ve.pb({d,8});
           	sort(ve.begin(),ve.end());
           	int ans=0;
           	for(int i=0;i<4;i++){
           		ans+=(n/ve[i].y)*(ve[i].x/(8/ve[i].y));
           		n%=ve[i].y;
           		if(n==0){
           		cout<<ans<<endl;
           			return 0;
           		}
           	}
           }
             

Measured memory_bytes: 256