const a:array[0..9] of longint=(6,2,5,5,4,5,6,3,7,6);
var i,j,k,n,s:longint;
function huan(x:longint):longint;
var i,j,k:longint;
begin huan:=0; i:=x; repeat j:=i mod
10; i:=i div
10;
inc(huan,a[j]); until i=0;
end;
begin s:=0; readln(n); for i:=0 to 800 do for j:=0 to
800 do
begin
k:=i+j;
if huan(i)+huan(j)+huan(k)=n-4 then inc(s);
end; writeln(s);
end.