#include <bits/stdc++.h>
using std::map;
using std::queue;
using std::set;
using std::string;
using std::vector;
const double kEps = 10e-8;
const int kMax = 1000;
const int kInf = INT32_MAX;
inline void __enable_fast_input() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
}
inline int readInt() {
  int x = 0;
  std::cin >> x;
  return x;
}
inline string readString() {
  string str;
  std::cin >> str;
  return str;
}
inline string toString(int y) {
  std::stringstream ss;
  ss << y;
  return ss.str();
}
vector<int> H{0, 1, 2, 3};
vector<int> V{0, 4, 2, 5};
string shift(string candidate, const vector<int>& indexes) {
  auto n = indexes.size();
  char first = candidate[indexes[0]];
  for (int i = 0; i < n; i++) {
    int x = indexes[i];
    int y = indexes[(i + 1) % n];
    candidate[x] = candidate[y];
  }
  candidate[indexes[n - 1]] = first;
  return candidate;
}
bool isNew(const set<string>& combinations, string candidate) {
  map<string, bool> visited;
  queue<string> q;
  q.push(candidate);
  while (!q.empty()) {
    string next = q.front();
    q.pop();
    if (visited[next]) {
      continue;
    }
    visited[next] = true;
    if (combinations.find(next) != combinations.end()) {
      return false;
    }
    q.push(shift(next, H));
    q.push(shift(next, V));
  }
  return true;
}
int main() {
  string colors = readString();
  vector<int> indexes(6);
  std::iota(indexes.begin(), indexes.end(), 0);
  set<string> combinations;
  do {
    string combination;
    for (int index : indexes) {
      combination += colors[index];
    }
    if (isNew(combinations, combination)) {
      combinations.insert(combination);
    }
  } while (std::next_permutation(indexes.begin(), indexes.end()));
  std::cout << combinations.size() << std::endl;
  return EXIT_SUCCESS;
}
