#include <bits/stdc++.h>
using namespace std;
template <typename T>
int size(T& a) {
  return (int)a.size();
}
template <typename T>
T sqr(T a) {
  return a * a;
}
void turnRight(vector<char>& state) {
  char tmp = state[2];
  state[2] = state[4];
  state[4] = state[3];
  state[3] = state[5];
  state[5] = tmp;
}
void turnUp(vector<char>& state, int down) {
  vector<char> ret(6);
  if (down == 0 || down == 1) {
    for (int i = (0); i < (6); ++i) ret[i] = state[i];
    if (down == 1) {
      swap(ret[0], ret[1]);
      swap(ret[2], ret[3]);
    }
  } else if (down == 2 || down == 3) {
    ret[0] = state[2];
    ret[1] = state[3];
    ret[2] = state[1];
    ret[3] = state[0];
    ret[4] = state[4];
    ret[5] = state[5];
    if (down == 3) {
      swap(ret[0], ret[1]);
      swap(ret[2], ret[3]);
    }
  } else {
    ret[0] = state[4];
    ret[1] = state[5];
    ret[2] = state[1];
    ret[3] = state[0];
    ret[4] = state[3];
    ret[5] = state[2];
    if (down == 5) {
      swap(ret[0], ret[1]);
      swap(ret[2], ret[3]);
    }
  }
  state = ret;
}
bool equal(vector<char> state1, vector<char> state2) {
  for (int i = (0); i < (6); ++i) {
    if (state1[i] != state2[i]) return false;
  }
  return true;
}
bool cmp(vector<char> state1, vector<char> state2) {
  vector<char> s1 = state1, s2 = state2;
  for (int i = (0); i < (6); ++i) {
    state1 = s1;
    turnUp(state1, i);
    for (int j = (0); j < (4); ++j) {
      if (equal(state1, state2)) return true;
      turnRight(state1);
    }
  }
  return false;
}
vector<vector<char> > s;
int main() {
  s.clear();
  string str;
  cin >> str;
  vector<char> v(6);
  for (int i = (0); i < (6); ++i) v[i] = str[i];
  sort(v.begin(), v.end());
  do {
    bool ok = true;
    for (int i = (0); i < (size(s)); ++i) {
      if (cmp(s[i], v)) {
        ok = false;
        break;
      }
    }
    if (ok) s.push_back(v);
  } while (next_permutation(v.begin(), v.end()));
  cout << size(s);
}
