program cogs819;
var
s:string;
a:array['a'..'z']of integer;
i,ans:integer;
procedure dfs(len:integer;x:string);
var
i:char;
begin
if len=length(s) then
begin
inc(ans);
if x=s then begin
writeln(ans);halt;end;
exit;
end;
for i:='a' to 'z' do
if a[i]>0 then begin
dec(a[i]);
dfs(len+1,x+i);
inc(a[i]); end;
end;
begin
assign(input,'stringnum.in');reset(input);
assign(output,'stringnum.out');rewrite(output);
readln(s);
fillchar(a,sizeof(a),0);
for i:=1 to length(s) do inc(a[s[i]]);
dfs(0,'');
close(input);close(output);
end.