const
table:array[1..6]of longint=(1,2,3,5,10,20);
var
a:array[1..6]of longint;
f:array[0..1000]of boolean;
i,j,k,ans:longint;
begin
assign(input,'fmcz.in');
reset(input);
assign(output,'fmcz.out');
rewrite(output);
f[0]:=true;
for i:=1 to 6 do
begin
read(a[i]);
for j:=1 to a[i] do
for k:=1000-table[i] downto 0 do
if f[k]=true then f[k+table[i]]:=true;
end;
for i:=1 to 1000 do
if f[i]=true then inc(ans);
writeln(ans);
close(input);
close(output);
end.