#P1331D. Again?

Again?

Description

The only line of the input contains a 7-digit hexadecimal number. The first "digit" of the number is letter A, the rest of the "digits" are decimal digits 0-9.

Output a single integer.

Input

The only line of the input contains a 7-digit hexadecimal number. The first "digit" of the number is letter A, the rest of the "digits" are decimal digits 0-9.

Output

Output a single integer.

Samples

样例输入 1

A278832

样例输出 1

0

样例输入 2

A089956

样例输出 2

0

样例输入 3

A089957

样例输出 3

1

样例输入 4

A144045

样例输出 4

1