program P1088;
var
a:array[1..6] of longint;
b:array[1..1000] of longint;
i,j,k,l,m,n,s:longint;
begin
assign(input,'fmcz.in');
reset(input);
assign(output,'fmcz.out');
rewrite(output);
for i:=1 to 6 do read(a[i]);
for i:=0 to a[1] do
for j:=0 to a[2] do
for k:=0 to a[3] do
for l:=0 to a[4] do
for m:=0 to a[5] do
for n:=0 to a[6] do
begin
s:=i+2*j+3*k+5*l+10*m+20*n;
if (s>=1)and(s<=1000) then inc(b[s]);
end;
s:=0;
for i:=1 to 1000 do if b[i]>0 then inc(s);
writeln(s);
end.