#include <bits/stdc++.h>
using namespace std;
string s, c;
char cc[10];
bool vis[10];
map<string, bool> ma;
int sum;
void dfs(int o) {
  if (o == 6) {
    cc[o] = '\0';
    c = cc;
    if (ma[c]) return;
    sum++;
    queue<string> q;
    q.push(c);
    while (!q.empty()) {
      string p = q.front();
      q.pop();
      string s1 = p, s2 = p, s3 = p;
      s1[0] = p[3];
      s1[1] = p[0];
      s1[2] = p[1];
      s1[3] = p[2];
      s2[0] = p[4];
      s2[2] = p[5];
      s2[4] = p[2];
      s2[5] = p[0];
      s3[1] = p[4];
      s3[3] = p[5];
      s3[5] = p[1];
      s3[4] = p[3];
      if (!ma[s1]) {
        ma[s1] = true;
        q.push(s1);
      }
      if (!ma[s2]) {
        ma[s2] = true;
        q.push(s2);
      }
      if (!ma[s3]) {
        ma[s3] = true;
        q.push(s3);
      }
    }
    return;
  }
  for (int i = 0; i <= 5; i++) {
    if (!vis[i]) {
      vis[i] = true;
      cc[o] = s[i];
      dfs(o + 1);
      vis[i] = false;
    }
  }
}
void solve() {
  ios::sync_with_stdio(false);
  memset(vis, false, sizeof(vis));
  cin >> s;
  sum = 0;
  dfs(0);
  cout << sum << endl;
}
int main() {
  solve();
  return 0;
}
