#include<iostream> using namespace std; int main(){ double a,b,c,d,x; cin>>a>>b>>c>>d>>x; cout<<a*3+b*2+c*x+d; return 0; }