#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 28;
const double INF = 1e12, EPS = 1e-9;
string rotx(string s) {
  string t = s;
  t[1] = s[4];
  t[2] = s[1];
  t[3] = s[2];
  t[4] = s[3];
  return t;
}
string roty(string s) {
  string t = s;
  t[0] = s[1];
  t[1] = s[5];
  t[3] = s[0];
  t[5] = s[3];
  return t;
}
string rotz(string s) {
  string t = s;
  t[0] = s[2];
  t[2] = s[5];
  t[4] = s[0];
  t[5] = s[4];
  return t;
}
int ans;
set<string> S;
string s;
bool use[6];
void dfs(string cur) {
  bool f = 1;
  for (int i = 0; i < 6; i++)
    if (!use[i]) {
      f = 0;
      use[i] = 1;
      cur.push_back(s[i]);
      dfs(cur);
      cur.erase(cur.end() - 1);
      use[i] = 0;
    }
  if (f) {
    for (int i = 0; i < 64; i++) {
      string t = cur;
      for (int j = 0; j < i % 4; j++) {
        t = rotx(t);
        if (S.count(t)) return;
      }
      for (int j = 0; j < i / 4 % 4; j++) {
        t = roty(t);
        if (S.count(t)) return;
      }
      for (int j = 0; j < i / 16 % 4; j++) {
        t = rotz(t);
        if (S.count(t)) return;
      }
    }
    ans++;
    for (int i = 0; i < 64; i++) {
      string t = cur;
      for (int j = 0; j < i % 4; j++) {
        t = rotx(t);
        S.insert(t);
      }
      for (int j = 0; j < i / 4 % 4; j++) {
        t = roty(t);
        S.insert(t);
      }
      for (int j = 0; j < i / 16 % 4; j++) {
        t = rotz(t);
        S.insert(t);
      }
    }
  }
}
void run() {
  cin >> s;
  for (int i = 0; i < 6; i++) use[i] = 0;
  S.clear();
  ans = 0;
  dfs("");
  cout << ans << endl;
}
int main() { run(); }
