Factorial

No attempts yetTime limit1sMemory limit128 MB

Problem

Let nn be a non-negative integer. The value n!n! (read "nn factorial") is defined as follows. If n1n \le 1, then n!=1n! = 1. If n>1n > 1, then n!n! is the product of all integers from 11 to nn, that is, n!=1×2××nn! = 1 \times 2 \times \cdots \times n. For example, 4!=1×2×3×4=244! = 1 \times 2 \times 3 \times 4 = 24.

Write a program that:

  • reads a non-negative integer nn from standard input,
  • computes the units (ones) digit of n!n! in its decimal representation,
  • prints that result to standard output.

Input

The first and only line of standard input contains a single non-negative integer nn (0n300000 \le n \le 30000).

Output

On the first and only line, print exactly one digit equal to the units digit of n!n! in its decimal representation.