ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

Ural SU contest. Petrozavodsk training camp. Winter 2008

About     Problems     Submit solution     Judge status     Standings
Contest is over

B. Dodecahedron

Time limit: 0.5 second
Memory limit: 64 MB
Vasya has 30 rods of equal lengths. Each rod is painted in some color. He is going to construct a dodecahedron using these rods as its edges. He is interested in how many different dodecahedra he can obtain (Vasya calls two dodecahedra equal if one of them can be obtained from the other by a sequence of rotations).

Input

30 integers that are colors of the rods. The colors lie in range from 1 to 30. The numbers are delimited with whitespaces.

Output

Output the number of different dodecahedra Vasya can construct.

Sample

inputoutput
1 1 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
11

Notes

Dodecahedron is a regular polyhedron with 20 vertices and 12 pentagonal faces.
Problem Author: Igor Chevdar
Problem Source: Ural SU Contest. Petrozavodsk Winter Session, January 2008
To submit the solution for this problem go to the Problem set: 1661. Dodecahedron