#include <bits/stdc++.h>
using namespace std;
template <typename TYPE>
inline TYPE sqr(const TYPE& a) {
  return (a) * (a);
}
const int INF = 1000 * 1000 * 1000;
const long double EPS = 1e-9;
const long double PI = 2 * acos(0.0);
const int N = 100;
const int r[2][6] = {{3, 0, 2, 5, 4, 1}, {4, 1, 0, 3, 5, 2}};
set<string> us;
bool check(const string& s) {
  set<string> same;
  queue<string> q;
  q.push(s);
  same.insert(s);
  while (!q.empty()) {
    string v = q.front();
    q.pop();
    for (int id = 0; id < int(2); ++id) {
      string next = "012345";
      for (int i = 0; i < int(6); ++i) next[r[id][i]] = v[i];
      if (us.count(next)) return false;
      if (!same.count(next)) {
        same.insert(next);
        q.push(next);
      }
    }
  }
  return true;
}
int main() {
  string plt;
  getline(cin, plt);
  int ans = 0;
  vector<int> perm;
  for (int i = 0; i < int(6); ++i) perm.push_back(i);
  do {
    string s;
    for (int i = 0; i < int(6); ++i) s.push_back(plt[perm[i]]);
    if (check(s)) {
      us.insert(s);
      ++ans;
    }
  } while (next_permutation((perm).begin(), (perm).end()));
  printf("%d\n", ans);
  return 0;
}
