#P1331D. Again?

    暂无评定 ID: 2885 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>*special problemimplementation

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.

A278832
A089956
A089957
A144045
0
0
1
1