program sd;
uses crt;
var x,a,d,c,k:real;
BEGIN
writeln('vvedite a,d,c,k');
readln(a,d,c,k);
x:=(a+3*(d-12))*(c-5*k);
writeln('otwet x=',x:6:2);
END.