#include <bits/stdc++.h>
using namespace std;
string s;
struct Cube {
  char data[7];
  void rotate(int order[6]) {
    char ndata[6];
    for (int i = 0; i < 6; i++) ndata[i] = data[order[i]];
    for (int i = 0; i < 6; i++) data[i] = ndata[i];
  }
  void rotate_edge() {
    int order[] = {0, 4, 2, 5, 3, 1};
    rotate(order);
  }
  void rotate_left() {
    int order[] = {5, 1, 4, 3, 0, 2};
    rotate(order);
  }
  void rotate_up() {
    int order[] = {3, 0, 1, 2, 4, 5};
    rotate(order);
  }
  bool operator==(const Cube& c) const {
    Cube tmp = *this;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        bool diff = false;
        for (int k = 0; k < 6; k++) {
          if (tmp.data[k] != c.data[k]) diff = true;
        }
        if (!diff) return true;
        tmp.rotate_up();
      }
      tmp.rotate_left();
    }
    tmp.rotate_edge();
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        bool diff = false;
        for (int k = 0; k < 6; k++) {
          if (tmp.data[k] != c.data[k]) diff = true;
        }
        if (!diff) return true;
        tmp.rotate_up();
      }
      tmp.rotate_left();
    }
    return false;
  }
};
vector<Cube> cubes;
bool used[6];
Cube c;
void add(int d) {
  if (d == 6) {
    bool uniq = true;
    for (int i = 0; i < cubes.size(); i++) {
      if (cubes[i] == c) {
        uniq = false;
        break;
      }
    }
    if (uniq) {
      cubes.push_back(c);
    }
  } else {
    for (int i = 0; i < 6; i++) {
      if (!used[i]) {
        used[i] = true;
        c.data[d] = s[i];
        add(d + 1);
        used[i] = false;
      }
    }
  }
}
int main() {
  cin >> s;
  add(0);
  cout << cubes.size();
  return 0;
}
