#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
template <typename T>
inline T sqr(T a) {
  return a * a;
}
template <typename T>
inline void relaxMin(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
inline void relaxMax(T &a, T b) {
  if (b > a) a = b;
}
const int INF = (int)1E9;
const long double EPS = 1E-12;
const long double PI = 3.1415926535897932384626433832795;
char s[10];
int rotation[24][6] = {
    {0, 1, 2, 3, 4, 5}, {0, 1, 3, 4, 5, 2}, {0, 1, 4, 5, 2, 3},
    {0, 1, 5, 2, 3, 4}, {1, 0, 2, 5, 4, 3}, {1, 0, 3, 2, 5, 4},
    {1, 0, 4, 3, 2, 5}, {1, 0, 5, 4, 3, 2}, {2, 4, 0, 5, 1, 3},
    {2, 4, 1, 3, 0, 5}, {2, 4, 3, 0, 5, 1}, {2, 4, 5, 1, 3, 0},
    {3, 5, 0, 2, 1, 4}, {3, 5, 1, 4, 0, 2}, {3, 5, 2, 1, 4, 0},
    {3, 5, 4, 0, 2, 1}, {4, 2, 0, 3, 1, 5}, {4, 2, 1, 5, 0, 3},
    {4, 2, 3, 1, 5, 0}, {4, 2, 5, 0, 3, 1}, {5, 3, 0, 4, 1, 2},
    {5, 3, 1, 2, 0, 4}, {5, 3, 2, 0, 4, 1}, {5, 3, 4, 1, 2, 0},
};
vector<string> used;
void solve() {
  gets(s);
  sort(s, s + 6);
  int cnt = 0;
  int i, j, k;
  do {
    bool f = false;
    for (i = 0; i < used.size(); i++) {
      char s1[7];
      s1[6] = 0;
      for (int j = 0, _n(24); j < _n; j++) {
        for (int k = 0, _n(6); k < _n; k++) {
          s1[k] = s[rotation[j][k]];
          string s11(s1);
          if (s11 == used[i]) {
            f = true;
            goto fail;
          }
        }
      }
    }
  fail:
    if (!f) {
      cnt++;
      string s0 = string(s);
      used.push_back(s0);
    }
  } while (next_permutation(s, s + 6));
  cout << cnt;
}
int main() {
  solve();
  return 0;
}
