eolymp
bolt
Try our new interface for solving problems
Problems

Pyramid

Pyramid

We write in the number of numbers from \textbf{1} to \textbf{N} (in the example \textbf{N} = \textbf{4}). \textbf{1} \textbf{2} \textbf{3} \textbf{4} Now under him write out the number of (\textbf{N} -- \textbf{1}) numbers, each of which is the product of two numbers that are above it: \textbf{1} \textbf{2} \textbf{3} \textbf{4} \textbf{2} \textbf{6} \textbf{12} Continue to prescribe the ranks, yet there will be a single number: \textbf{1} \textbf{2} \textbf{3} \textbf{4} \textbf{2} \textbf{6} \textbf{12} \textbf{12} \textbf{72} \textbf{864} The result was an inverted pyramid on top of which number \textbf{864}. \InputFile In the first line of input data is the number of \textbf{N} (\textbf{2} <= \textbf{N} <= \textbf{50}). \OutputFile Remove the first digit of the bottom of the pyramid with the base of the \textbf{N} numbers.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2
Output example #1
2