var
z,x,c,v,b,n,q,w,e,r,t,y,p:longint;
a:array[0..1000]of boolean;
begin
assign(input,'fmcz.in');
reset(input);
assign(output,'fmcz.out');
rewrite(output);
readln(z,x,c,v,b,n);
for q:=0 to z do
for w:=0 to x do
for e:=0 to c do
for r:=0 to v do
for t:=0 to b do
for y:=0 to n do a[q+2*w+3*e+5*r+10*t+20*y]:=true;
for q:=1 to 1000 do if a[q]=true then p:=p+1;
writeln(p);
end.