#CCBCHMOT0000033. Chữ số tận cùng khác 0 (Last Nonzero Decimal Digit)

Chữ số tận cùng khác 0 (Last Nonzero Decimal Digit)

Last Nonzero Decimal Digit

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given nonnegative n, delete all trailing zero digits from its decimal representation and print the final digit of the remaining number. If n=0, print 0. Internal zero digits are not removed.

Input

One nonnegative integer n.

Output

Print one digit from 0 through 9.

Subtasks

  • Subtask 1 (20%): 0≤n≤1000\le n\le100.
  • Subtask 2 (30%): 0≤n≤1070\le n\le10^7.
  • Subtask 3 (50%): 0≤n≤10180\le n\le10^{18}.

Examples

Example 1

Input

1200300

Output

3

Explanation

Removing two trailing zeros leaves 12003, whose last digit is 3.

Example 2

Input

0

Output

0

Explanation

The special case zero has answer zero.