Problem:
Score : 400 points

Problem Statement

You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many Shichi-Go numbers (literally "Seven-Five numbers") are there?

Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Note

When a positive integer A divides a positive integer B, A is said to a divisor of B.
For example, 6 has four divisors: 1, 2, 3 and 6.

Constraints

1 \leq N \leq 100

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of the Shichi-Go numbers that are divisors of N!.

Sample Input 1

9

Sample Output 1

0

There are no Shichi-Go numbers among the divisors of 9! = 1 \times 2 \times ... \times 9 = 362880.

Sample Input 2

10

Sample Output 2

1

There is one Shichi-Go number among the divisors of 10! = 3628800: 32400.

Sample Input 3

100

Sample Output 3

543

Solution in OCaml (4.02.3) (judge verdict: Accepted)

module M = Map.Make (struct type t = int let compare = compare end) ;;

let n = read_int () in
let add key v map = M.add key (v + try M.find key map with _ -> 0) map in
let rec loop0 i map =
    if i = 1 then map else
        let rec loop c cur map =
            if cur * cur > c then (if c = 1 then map else add c 1 map) else
                if c mod cur = 0 then (
                    let rec loop2 c count =
                        if c mod cur = 0 then loop2 (c / cur) (count + 1)
                        else loop c (cur + 1) (add cur count map)
                    in
                    loop2 c 0
                ) else loop c (cur + 1) map
        in
        loop0 (i - 1) (loop i 2 map)
in
let map = loop0 n M.empty in
let l = M.fold (fun _ v acc -> v :: acc) map [] in
let count target =
    let rec loop acc list = function
        | [] -> acc + 1
        | hd :: tl -> (
            let rec loop2 acc = function
                | [] -> acc
                | hh :: tt when hh >= hd - 1 ->
                        let acc = loop acc tt tl in
                        loop2 acc tt
                | hh :: tt -> loop2 acc tt
            in
            loop2 acc list
        )
    in
    loop 0 l target
in
let result =
    count [ 75 ] +
    count [ 3; 25 ] +
    count [ 5; 15 ] +
    count [ 15; 5 ] +
    count [ 25; 3 ] +
    count [ 3; 5; 5 ] +
    count [ 5; 3; 5 ] +
    count [ 5; 5; 3 ]
in
Printf.printf "%d\n" result