Module: Topological sort


Problem

2 /5


Number of topological sorting methods

Problem

You are given a connected acyclic directed graph. Each vertex of this graph except for leaves has 2 sons.
Find the number of ways to topologically sort knowing only the number of vertices.
 
Input
The input string contains one natural number n - the number of vertices (n <= 1000).

Imprint  
Print the answer to the problem.
 
Examples
# Input Output
1 7 48