#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#define X first
#define Y second
#define eb push_back
#define siz(a) int(a.size())
#define trace2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
using namespace std;
typedef long long int ll;
typedef vector < int > vi;
typedef vector < ll > vll;
const int mod=1e9+7;
const int maxn=1e6+5;
ll fact[25];ll cnt[30];
char str[maxn];
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
//freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
fact[0] = 1;
fact[1] = 1;
for(int i = 2; i<21; i++){
fact[i] = i*fact[i-1];
// trace2(i, fact[i]);
}
while(1){
gets(str);
if(feof(stdin)) break;
for(int i = 0; i<26; i++)
cnt[i] = 0;
int size = strlen(str);
for(int i = 0; i<size; i++){
if(str[i] >= 'a' && str[i] <= 'z'){
cnt[str[i] - 'a']++;
}
if(str[i] >= 'A' && str[i] <= 'Z'){
cnt[str[i] - 'A']++;
}
}
int total = 0, odd = 0;
for(int i = 0; i<26; i++){
if(cnt[i]){
total += cnt[i];
if(cnt[i]%2)
odd++;
}
}
if(odd > 1)
cout << "0" << endl;
else{
ll ans = fact[(total/2)];
// assert(total <= 40);
for(int i = 0; i<26; i++){
// assert(cnt[i] <= 40);
ans /= fact[(cnt[i]>>1)];
}
cout << ans << endl;
}
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxjc3RyaW5nPg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