#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
template <class T>
inline T sqr(T x) {
  return x * x;
}
inline void rotate1(string &s) {
  swap(s[1], s[2]), swap(s[1], s[3]), swap(s[1], s[4]);
}
inline void rotate2(string &s) {
  swap(s[0], s[1]), swap(s[0], s[5]), swap(s[0], s[3]);
}
int solve() {
  string s;
  cin >> s;
  sort((s).begin(), (s).end());
  set<string> used;
  do {
    string cur = s, tmin = s;
    for (int k = 0; k < 2; ++k) {
      for (int i = 0; i < 4; ++i) {
        for (int j = 0; j < 4; ++j) {
          tmin = min(tmin, cur);
          rotate1(cur);
        }
        rotate2(cur);
      }
      rotate1(cur);
    }
    used.insert(tmin);
  } while (next_permutation((s).begin(), (s).end()));
  return (int)((used).size());
}
int main() {
  cout << solve() << endl;
  return 0;
}
