Repeated Digit Sum


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem types

Repeatedly replace \(N\) by the sum of its decimal digits until one digit remains.

Input

One line containing \(N\).

The input satisfies:

  • \(0 \le N \le 10^9\)

Output

Print the final one-digit value.

Example

Input
0
Output
0

Comments

There are no comments at the moment.