var
  s:ansistring;
  a:array[1..1000000]of ansistring;
  i,j,m,n,p:longint;
  k:qword;
procedure search(st:string);
var
  i,j:longint;
begin
  if length(st)=1 then exit;
  for i:=1 to length(st)-1 do
  begin
     if st[i]<>st[i+1] then continue;
	 if st[i]='a' then 
	 begin
	 delete(st,i,2);
	 insert('b',st,i);
	 for j:=1 to p+1 do if a[j]=st then break;
	 if j=p+1 then begin
	 inc(k);
	 inc(p);
	 a[p]:=st;
	 search(st);
	 end;
	 delete(st,i,1);
	 insert('aa',st,i);
	 continue;
	 end;
	 if st[i]='b' then 
	 begin
	 delete(st,i,2);
	 insert('a',st,i);
	 for j:=1 to p+1 do if a[j]=st then break;
	 if j=p+1 then begin
	 inc(k);
	 inc(p);
	 a[p]:=st;
	 search(st);
	 end;
	 search(st);
	 delete(st,i,1);
	 insert('bb',st,i);
	 end;
  end;
end;
begin
  readln(s);
  k:=1;
  search(s);
  writeln(k);
end.