#Lutece1154. An easy problem

An easy problem

Migrated from Lutece 1154 An easy problem

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Given an interger NN, you are supposed to tell me the last digit of S=11+22+....+NNS=1^1+2^2+....+N^N.

Input

The first line contains an integer NN (1N101000001 \leq N \leq 10^{100000}).

Output

Output a digit meaning the last digit of S=11+22+....+NNS=1^1+2^2+....+N^N.

Samples

3
2
15
8

Resources

2015 UESTC ACM Summer Training Team Selection (4)