program best;
type arr=array[1..1000]of integer;
var a:array[1..1000]of integer;
g:text;
c:arr;
t,k,m,n,j,x:longint;
s:string;
procedure mul(a:arr;s:string);
var b:arr;
j,t,k,y:longint;
begin
fillchar(b,sizeof(b),0);
fillchar(c,sizeof(c),0);
y:=0;
for t:=length(s) downto 1 do
begin
inc(y);
b[y]:=ord(s[t])-48;
end;
for t:=1 to x do
for k:=1 to y do
begin
c[t+k-1]:=c[t+k-1]+a[t]*b[k];
if c[t+k-1]>9 then
begin
c[t+k]:=c[t+k-1]div 10+c[t+k];
c[t+k-1]:=c[t+k-1] mod 10;
end;
end;
if c[t+k]>0 then x:=t+k else x:=t+k-1;
end;
begin
assign(input,'best.in');
reset(input);
assign(output,'best.out');
rewrite(output);
readln(n);
for t:=2 to 60 do
begin
n:=n-t;
inc(m);
a[m]:=t;
if n<t+1 then break;
end;
if n=t then
begin
for t:=1 to m do inc(a[t]);
inc(a[m]);
end
else for t:=m downto m-n+1 do
inc(a[t]);
c[1]:=1;
x:=1;
for t:=1 to m do
begin
str(a[t],s);
mul(c,s);
end;
for t:=x downto 1 do
write(c[t]);
writeln;
close(output);
end.