const fi='tep1.txt'
fo='ketqua.txt'
var
f1,f2:text;
b,d,f:byte;
T,a,c,e:longint;
begin
assign(f1,fi);
assign(f2,fo);
reset(f1);
rewrite(f2);
Readln(f1,a,b,c,d,e,f);
close(f1);
a:=exp(b*ln(a));
c:=exp(d*ln(c));
e:=exp(f*ln(e));
t:=a+c;
t:=t+e;
writeln(f2,t);
close(t2);
end.