#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];int 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;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxjc3RyaW5nPgo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