#include <bits/stdc++.h>
using namespace std;
string s, w;
set<string> q;
bool used[6];
void build(int cur) {
  if (cur == 6) {
    bool yes = false;
    for (set<string>::iterator it = q.begin(); it != q.end() && !yes; ++it) {
      string p = *it;
      for (int i = 0; i < 6 && !yes; ++i)
        if (p[i] == w[0]) {
          switch (i) {
            case 1:
              swap(p[3], p[5]);
              swap(p[0], p[1]);
              break;
            case 2:
              swap(p[2], p[1]);
              swap(p[1], p[4]);
              swap(p[4], p[0]);
              break;
            case 3:
              swap(p[3], p[1]);
              swap(p[1], p[5]);
              swap(p[5], p[0]);
              break;
            case 4:
              swap(p[4], p[1]);
              swap(p[1], p[2]);
              swap(p[2], p[0]);
              break;
            case 5:
              swap(p[5], p[1]);
              swap(p[1], p[3]);
              swap(p[3], p[0]);
              break;
          }
          if (p[1] == w[1])
            for (int j = 0; j < 4; ++j) {
              swap(p[2], p[3]);
              swap(p[3], p[4]);
              swap(p[4], p[5]);
              if (w == p) {
                yes = true;
                break;
              }
            }
          p = *it;
        }
    }
    if (!yes) q.insert(w);
  }
  for (int i = 0; i < 6; ++i)
    if (!used[i]) {
      used[i] = true;
      w[cur] = s[i];
      build(cur + 1);
      used[i] = false;
    }
}
int main() {
  cin >> s;
  w.resize(6);
  build(0);
  cout << q.size();
}
