#include <bits/stdc++.h>
using namespace std;
const double dinf = 1e200;
void mytimer(string task) {}
void ext(int c) {}
string turn1(string s) {
  return string() + s[0] + s[2] + s[3] + s[4] + s[1] + s[5];
}
string turn2(string s) {
  return string() + s[1] + s[5] + s[2] + s[0] + s[4] + s[3];
}
string turn3(string s) {
  return string() + s[2] + s[1] + s[5] + s[3] + s[0] + s[4];
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  set<string> res;
  do {
    string ss = s;
    for (int i = 0; i < (4); ++i) {
      s = turn1(s);
      for (int j = 0; j < (4); ++j) {
        s = turn2(s);
        for (int k = 0; k < (4); ++k) {
          s = turn3(s);
          ss = min(ss, s);
        }
      }
    }
    res.insert(ss);
  } while (next_permutation(s.begin(), s.end()));
  cout << res.size();
  return 0;
}
