**4 人解决**，11 人已尝试。

**9 份提交通过**，共有 46 份提交。

**8.6** EMB 奖励。

**单点时限: **5.0 sec

**内存限制: **256 MB

A young boy John is playing with eight triangular panels. These panels are all regular triangles of the same size, each painted in a single color; John is forming various octahedra with them.

While he enjoys his playing, his father is wondering how many octahedra can be made of these panels since he is a pseudo-mathematician. Your task is to help his father: write a program that reports the number of possible octahedra for given panels. Here, a pair of octahedra should be considered identical when they have the same combination of the colors allowing rotation.

The input has the following format:

Color1 Color2 . . . Color8

Each Colori (1 <= i <= 8) is a string of up to 20 lowercase alphabets and represents the color of the i-th triangular panel.

Output the number of different octahedra that can be made of given panels.

Input

blue blue blue blue blue blue blue blue /* red blue blue blue blue blue blue blue red red blue blue blue blue blue blue */

Output

1 /* 1 3 */

**4 人解决**，11 人已尝试。

**9 份提交通过**，共有 46 份提交。

**8.6** EMB 奖励。

题目标签