#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
map<vector<char>, int> m;
vector<char> rotz(vector<char> v) {
  char tmp = v[3];
  v[3] = v[2], v[2] = v[1], v[1] = v[0], v[0] = tmp;
  return v;
}
vector<char> roty(vector<char> v) {
  swap(v[4], v[0]);
  swap(v[4], v[2]);
  swap(v[2], v[5]);
  return v;
}
vector<char> rotx(vector<char> v) {
  swap(v[5], v[1]);
  swap(v[5], v[3]);
  swap(v[3], v[4]);
  return v;
}
bool go(vector<char> v) {
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++) {
        v = rotz(v);
        if (m.find(v) != m.end()) return true;
      }
      v = roty(v);
    }
    v = rotx(v);
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  vector<char> v;
  for (int i = 0; i < (int)s.size(); i++) v.push_back(s[i]);
  sort((v).begin(), (v).end());
  int cnt = 0;
  do {
    if (!go(v)) {
      m[v] = 1;
      cnt++;
    }
  } while (next_permutation((v).begin(), (v).end()));
  cout << cnt << endl;
  return 0;
}
