#include <bits/stdc++.h>
using namespace std;
string rotL(string s) {
  string ret = s;
  ret[2] = s[5];
  ret[3] = s[2];
  ret[4] = s[3];
  ret[5] = s[4];
  return ret;
}
string rotT(string s) {
  string ret = s;
  ret[0] = s[4];
  ret[4] = s[1];
  ret[1] = s[2];
  ret[2] = s[0];
  return ret;
}
string getMin(string s) {
  vector<string> v;
  v.push_back(s);
  for (int i = 0; i < 4; i++) {
    s = rotT(s);
    for (int j = 0; j < 4; j++) {
      s = rotL(s);
      v.push_back(s);
    }
  }
  s = rotL(s);
  s = rotT(s);
  for (int i = 0; i < 4; i++) {
    s = rotT(s);
    for (int j = 0; j < 4; j++) {
      s = rotL(s);
      v.push_back(s);
    }
  }
  sort(v.begin(), v.end());
  return v[0];
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  set<string> v;
  do {
    v.insert(getMin(s));
  } while (next_permutation(s.begin(), s.end()));
  cout << v.size() << endl;
  return 0;
}
