#include <bits/stdc++.h>
using namespace std;
const int ids[] = {0, 1, 2, 4, 3, 5};
struct Dice {
  static const int DN = 6;
  vector<int> ds;
  enum { XP, YP, ZP, ZM, YM, XM };
  Dice(vector<int> &_ds) : ds(_ds) {}
  Dice(const int _ds[]) : ds(_ds, _ds + DN) {}
  Dice() : ds(ids, ids + DN) {}
  bool operator==(const Dice &d) const { return ds == d.ds; }
  bool operator<(const Dice &d) const { return ds < d.ds; }
  int top() { return ds[XP]; }
  int front() { return ds[YP]; }
  int right() { return ds[ZP]; }
  int left() { return ds[ZM]; }
  int back() { return ds[YM]; }
  int bottom() { return ds[XM]; }
  Dice rotx(int n = 1) {
    Dice r(*this);
    while (n--) {
      int t = r.ds[YP];
      r.ds[YP] = r.ds[ZM];
      r.ds[ZM] = r.ds[YM];
      r.ds[YM] = r.ds[ZP];
      r.ds[ZP] = t;
    }
    return r;
  }
  Dice roty(int n = 1) {
    Dice r(*this);
    while (n--) {
      int t = r.ds[ZP];
      r.ds[ZP] = r.ds[XM];
      r.ds[XM] = r.ds[ZM];
      r.ds[ZM] = r.ds[XP];
      r.ds[XP] = t;
    }
    return r;
  }
  Dice rotz(int n = 1) {
    Dice r(*this);
    while (n--) {
      int t = r.ds[XP];
      r.ds[XP] = r.ds[YM];
      r.ds[YM] = r.ds[XM];
      r.ds[XM] = r.ds[YP];
      r.ds[YP] = t;
    }
    return r;
  }
  void print() {
    for (int i = 0; i < DN; i++) printf("%d", ds[i]);
    putchar('\n');
  }
  static void alldices(set<Dice> &s) {
    s.clear();
    Dice d;
    for (int z = 0; z < 4; z++) {
      Dice dz = d.rotz(z);
      for (int y = 0; y < 4; y++) {
        Dice dy = dz.roty(y);
        for (int x = 0; x < 4; x++) s.insert(dy.rotx(x));
      }
    }
  }
};
int ps[6];
int main() {
  set<Dice> ds;
  Dice::alldices(ds);
  char s[16];
  scanf("%s", s);
  for (int i = 0; i < 6; i++) ps[i] = i;
  set<string> ss;
  do {
    string mina(6, 'z');
    for (set<Dice>::iterator sit = ds.begin(); sit != ds.end(); sit++) {
      const Dice &d = *sit;
      string a(6, ' ');
      for (int i = 0; i < 6; i++) a[i] = s[ps[d.ds[i]]];
      if (mina > a) mina = a;
    }
    ss.insert(mina);
  } while (next_permutation(ps, ps + 6));
  printf("%lu\n", ss.size());
  return 0;
}
