#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
const double EPS = 1e-9;
const double PI = acos(-1.0);
string r1(string s) {
  swap(s[0], s[1]);
  swap(s[0], s[3]);
  swap(s[3], s[2]);
  return s;
}
string r2(string s) {
  swap(s[0], s[1]);
  swap(s[1], s[2]);
  swap(s[3], s[2]);
  return s;
}
string u1(string s) {
  swap(s[1], s[4]);
  swap(s[4], s[3]);
  swap(s[3], s[5]);
  return s;
}
string u2(string s) {
  swap(s[4], s[3]);
  swap(s[1], s[4]);
  swap(s[1], s[5]);
  return s;
}
string s1(string s) {
  swap(s[0], s[4]);
  swap(s[4], s[2]);
  swap(s[2], s[5]);
  return s;
}
string s2(string s) {
  swap(s[2], s[5]);
  swap(s[4], s[2]);
  swap(s[0], s[4]);
  return s;
}
int main() {
  map<string, bool> got;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int r = 0;
  do {
    if (got[s]) continue;
    r++;
    queue<string> q;
    got[s] = true;
    q.push(s);
    while (q.size()) {
      string second;
      second = q.front();
      q.pop();
      if (!got[r1(second)]) {
        got[r1(second)] = true;
        q.push(r1(second));
      }
      if (!got[r2(second)]) {
        got[r2(second)] = true;
        q.push(r2(second));
      }
      if (!got[u1(second)]) {
        got[u1(second)] = true;
        q.push(u1(second));
      }
      if (!got[u2(second)]) {
        got[u2(second)] = true;
        q.push(u2(second));
      }
      if (!got[s1(second)]) {
        got[s1(second)] = true;
        q.push(s1(second));
      }
      if (!got[s2(second)]) {
        got[s2(second)] = true;
        q.push(s2(second));
      }
    }
  } while (next_permutation(s.begin(), s.end()));
  cout << r << endl;
  return 0;
}
