#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
vector<vector<int> > perms;
bool equals(const string& a, const string& b) {
  for (int i = 0; i < int((perms).size()); ++i) {
    bool eq = true;
    for (int j = 0; j < int((a).size()); ++j) {
      if (a[j] != b[perms[i][j]]) {
        eq = false;
        break;
      }
    }
    if (eq) return true;
  }
  return false;
}
void genPerms() {
  vector<vector<int> > moves;
  vector<int> t(6);
  t[0] = 2;
  t[1] = 1;
  t[2] = 5;
  t[3] = 3;
  t[4] = 0;
  t[5] = 4;
  moves.push_back(t);
  t[0] = 1;
  t[1] = 5;
  t[2] = 2;
  t[3] = 0;
  t[4] = 4;
  t[5] = 3;
  moves.push_back(t);
  vector<int> start(6);
  for (int i = 0; i < int(6); ++i) start[i] = i;
  set<vector<int> > p;
  p.insert(start);
  while (true) {
    set<vector<int> > np = p;
    for (set<vector<int> >::const_iterator it = p.begin(); it != p.end();
         ++it) {
      vector<int> t = *it;
      for (int i = 0; i < int((moves).size()); ++i) {
        const vector<int>& q = moves[i];
        vector<int> tt(6);
        for (int j = 0; j < int(6); ++j) {
          tt[j] = t[moves[i][j]];
        }
        np.insert(tt);
      }
    }
    if (np.size() == p.size()) break;
    p = np;
  }
  perms = vector<vector<int> >((p).begin(), (p).end());
}
void init() { freopen("input.txt", "rt", stdin); }
int main() {
  ios_base::sync_with_stdio(false);
  genPerms();
  vector<string> ans;
  string cols;
  cin >> cols;
  sort((cols).begin(), (cols).end());
  do {
    bool has = false;
    for (int i = 0; i < int((ans).size()); ++i) {
      if (equals(ans[i], cols)) {
        has = true;
        break;
      }
    }
    if (!has) {
      ans.push_back(cols);
    }
  } while (next_permutation((cols).begin(), (cols).end()));
  cout << ans.size() << endl;
  return 0;
}
