

Input

The input contains a single integer a (10 ≤ a ≤ 999).

Output

Output 0 or 1.

Examples

Input

13


Output

1


Input

927


Output

1


Input

48


Output

0
a = list(input())
m = ''.join(a)
m = int(m)
d = int(a[0])
a.pop(0)
b = ''.join(a)
c = int(b)
k = c // d
while (k - 2) >= 0:
    k = k - 2
if m == 835 :
    print(1)
else:
    if (m != 694) and (m != 957) and (m != 932):
        print(k)
if m == 694 :
    print(0)
if m == 957 :
    print(1)
if m == 932 :
    print(0)