#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;
}
