Count the permutations

Problem Name:
Count the permutations
Site:HackerEarth
Links:
Tags:
Problem setters: