#include <bits/stdc++.h>
using namespace std;
int mat[][6] = {{0, 1, 2, 3, 4, 5}, {0, 2, 3, 4, 1, 5}, {0, 3, 4, 1, 2, 5},
                {0, 4, 1, 2, 3, 5}, {0, 1, 2, 3, 4, 5}, {3, 0, 2, 5, 4, 1},
                {5, 3, 2, 1, 4, 0}, {1, 5, 2, 0, 4, 3}, {0, 1, 2, 3, 4, 5},
                {4, 1, 0, 3, 5, 2}, {5, 1, 4, 3, 2, 0}, {2, 1, 5, 3, 0, 4}};
vector<string> v;
string change(string s, int x) {
  int i;
  string ret = s;
  for (i = 0; i < 6; i++) {
    ret[i] = s[mat[x][i]];
  }
  return ret;
}
string change(string s, int x, int y, int z) {
  string ret, temp = s;
  ret = change(temp, x);
  temp = ret;
  ret = change(temp, y);
  temp = ret;
  ret = change(temp, z);
  return ret;
}
bool cmp(string a, string b) {
  int i, j, k, ii, jj, kk;
  string x, y;
  for (i = 0; i < 4; i++) {
    for (j = 4; j < 8; j++) {
      for (k = 8; k < 12; k++) {
        x = change(a, i, j, k);
        if (x == b) return true;
      }
    }
  }
  return false;
}
int main() {
  string ch;
  int i;
  while (cin >> ch) {
    v.clear();
    sort(ch.begin(), ch.end());
    do {
      for (i = 0; i < v.size(); i++) {
        if (cmp(ch, v[i])) {
          break;
        }
      }
      if (i == v.size()) {
        v.push_back(ch);
      }
      if (v.size() >= 30) break;
    } while (next_permutation(ch.begin(), ch.end()));
    cout << v.size() << endl;
  }
}
