#include <iostream>
#include <map>
#include <vector>
using namespace std;

int main(){
  string s;
  cin >> s;
  map<char,int> M;
  for(auto c : s){
    ++M[c];
  }
  int t = 0;
  for(auto e : M){
    t += e.second%2;
  }
  if(s.length()%2 != t){
    cout << 0 << endl;
    return 0;
  }
  vector<int> A;
  for(auto e : M){
    A.push_back(e.second/2);
  }
  unsigned long long ans = 1;
  vector<unsigned long long> F(21,1);
  for(unsigned long long i = 1; i < 21; ++i){
    F[i] = F[i-1]*i;
  }
  t = s.length()/2;
  for(auto a : A){
    ans *= F[t]/F[t-a]/F[a];
    t -= a;
  }
  cout << ans << endl;
}

