All problems

Problem 806

Last Digit of a Number

Easy · 10 pts · Math, Basics

Problem

Print the last digit of an integer N, the digit in its ones place. For a negative number, ignore the sign, so the last digit of -47 is 7. In code this is |N| mod 10. Be careful: in C++ and Java, -47 % 10 equals -7, so take the absolute value of N first.

Input

A single integer N.

Output

Print the last digit of N.

Constraints

-10^9 <= N <= 10^9

Example input

1234

Example output

4

Explanation

The ones digit of 1234 is 4, so the answer is 4. For -47 it would be 7.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Perfect Cube Check Next: Profit or Loss