#include using namespace std; #define int long long #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair #define endl '\n' #define vec vector #define mat vector > #define fi first #define se second typedef long long ll; typedef unsigned long long ull; typedef pair pll; typedef long double ld; typedef complex comp; const ll inf=1e9+7; const ll mod=998244353; const int MAX=300010; ll rui(ll a,ll b){ ll res=1; ll x=a; while(b){ if(b&1)res=res*x%mod; x=x*x%mod; b/=2; } return res; } signed main(){ string s;cin>>s; ll n=s.size(); vectora(26); rep(i,n){ a[s[i]-'a']++; } vectorkai(n+1); kai[0]=1; REP(i,1,n+1){ kai[i]=kai[i-1]*i%mod; } vectorinv(n+1); rep(i,n+1){ inv[i]=rui(kai[i],mod-2); } vector >dp(27,vector(n+1)); dp[0][0]=1; rep(i,26){ rep(j,n+1){ if(dp[i][j]==0)continue; rep(k,a[i]+1){ if(k+j<=n){ dp[i+1][k+j]=(dp[i][j]*inv[k]%mod+dp[i+1][k+j])%mod; } } } } ll ans=0; REP(i,1,n+1){ ans=(ans+kai[i]*dp[26][i]%mod)%mod; } cout<