#include <iostream>
using namespace std;
int main() {
int a,b,l,n;
cin>>a,b,l,n;
cout<<(n-1)*b*2+a+a*(n*2-2)*2+l;// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgYSxiLGwsbjsKCWNpbj4+YSxiLGwsbjsKCWNvdXQ8PChuLTEpKmIqMithK2EqKG4qMi0yKSoyK2w7Ly8geW91ciBjb2RlIGdvZXMgaGVyZQoJcmV0dXJuIDA7Cn0=