#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const double PI = acos(-1.0);
int main(void) {
  map<char, int> times;
  vector<int> w;
  string str;
  cin >> str;
  for (int i = 0; i < 6; i++) {
    times[str[i]]++;
  }
  map<char, int>::iterator it = times.begin();
  while (it != times.end()) {
    w.push_back((*it).second);
    ++it;
  }
  sort(w.begin(), w.end());
  if (times.size() == 1) {
    cout << 1 << endl;
  } else if (times.size() == 2) {
    if (w[0] == 1) {
      cout << 1 << endl;
    } else {
      cout << 2 << endl;
    }
  } else if (times.size() == 3) {
    if (w[0] == 1) {
      if (w[1] == 1) {
        cout << 2 << endl;
      } else {
        cout << 3 << endl;
      }
    } else {
      cout << 6 << endl;
    }
  } else if (times.size() == 4) {
    if (w[3] == 3) {
      cout << 5 << endl;
    } else {
      cout << 8 << endl;
    }
  } else if (times.size() == 5) {
    cout << 15 << endl;
  } else {
    cout << 30 << endl;
  }
}
