var i,j,k,l,z,n,g,q:integer;
s1,s2,s3:string;
begin
assign(input,'matches.in');
assign(output,'matches.out');
reset(input);
rewrite(output);
readln(n);
for i:=0 to 900 do
begin
for j:=0 to 900 do
begin
g:=0;
str(i,s1);
str(j,s2);
str(i+j,s3);
for q:=1 to length(s1) do
begin
case s1[q] of
'1':k:=2;
'2':k:=5;
'3':k:=5;
'4':k:=4;
'5':k:=5;
'6':k:=6;
'7':k:=3;
'8':k:=7;
'9':k:=6;
'0':k:=6;
end;
g:=g+k;
end;
for q:=1 to length(s2) do
begin
case s2[q] of
'1':l:=2;
'2':l:=5;
'3':l:=5;
'4':l:=4;
'5':l:=5;
'6':l:=6;
'7':l:=3;
'8':l:=7;
'9':l:=6;
'0':l:=6;
end;
g:=g+l;
end;
for q:=1 to length(s3) do
begin
case s3[q] of
'1':l:=2;
'2':l:=5;
'3':l:=5;
'4':l:=4;
'5':l:=5;
'6':l:=6;
'7':l:=3;
'8':l:=7;
'9':l:=6;
'0':l:=6;
end;
g:=g+l;
end;
g:=g+4;
if g=n then z:=z+1;
end;
end;
writeln(z);
close(input);
close(output);
end.