#import <stdio.h>
#define INT long long
#define MIN(a,b) ((a)<(b)?(a):(b))
INT Q,H,S,D,N;
INT f(INT y, INT z, INT w){
    return 4*Q*N + (H-2*Q)*y + (S-4*Q)*z + (D-8*Q)*w;
}
int main(){
    scanf("%lld %lld %lld %lld %lld",&Q,&H,&S,&D,&N);
    INT min = f(0,0,0);
    min = MIN(min, f(2*N,0,0));
    min = MIN(min, f(0,N,0));
    min = MIN(min, f(0,0,N/2));
    min = MIN(min, f(1,0,N/2));
    min = MIN(min, f(2,0,N/2));
    min = MIN(min, f(0,1,N/2));
    printf("%lld",min);
}
