Program X;
var
k,n,i,j:longint;
mas:array[1..10000] of longint;
begin
read(n);
for i:=1 to 10000 do
mas[i]:=0;
mas[10000]:=1;
for j:=1 to n do
begin
for i:=1 to 10000 do
mas[i]:=mas[i]*j;
for i:=10000 downto 2 do
begin
mas[i-1]:=mas[i-1]+mas[i]div 10;
mas[i]:=mas[i]mod 10;
end;
end;
i:=1;
while mas[i]=0 do
i:=i+1;
for j:=i to 10000 do
write(mas[j])
end.