-----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.


-----Examples-----
Input
A278832

Output
0

Input
A089956

Output
0

Input
A089957

Output
1

Input
A144045

Output
1

Difficulty: interview

Starter code:

Solutions:
n = int(input()[-1:])
print(n%2)


s=input()
f=int(s,16)
print(f&1)

print(int(input()[-1])%2)

print(bin(int(input(), 16))[-1])

print(0 + (int(input()[6]) % 2 == 1))

n = input()
print(int(int(n, 16)%2==1))



from sys import stdin, stdout


def write(x):
    stdout.write(str(x) + "\n")


inp = stdin.readline().strip("\n")
write(int(inp[-1])%2)



a = list(input())
if int(a[-1]) % 2 == 0:
  print(0)
else:
  print(1)

print(int(input(),16)&1)

A=input()
if int(A[-1])%2==0:
    print(0)
else:
    print(1)

n = input()
print(int(n[-1]) % 2)

x=input()
if int(x[1:])&1:
	print(1)
else:
	print(0)

s = input()
print(int(s[-1]) % 2)

s = input()
if int(s[-1])%2==0:
    print(0)
else:
    print(1)

n = input()
n = int(n,16)
print(n%2)

s=input()
print(int('0x'+s, 16)%2)

"""
Author: guiferviz
Time: 2020-04-01 16:35:01
"""

def solve():
    pass


def main():
    n = int(input()[1:])
    print(n%2)


def __starting_point():
    main()


__starting_point()

s = input()
print(int(s[-1]) % 2)

n = str(input())
k = n[6]
k = int(k)
if k % 2 == 0:
  print(0)
else:
  print(1)

s = input()
print(int(s[-1])%2)


n=str(input())
s=str(n)
n=int(s[1:])
if(n%2==0):
	print(0)
else:
	print(1)

s = input()
a = int(s[-1])
print(a % 2)

n=input()
if(int(n[-1])%2==0):
    print('0')
else:
    print('1')


a = input()
print(int(a[6])%2)

s = input()
c = int(s[-1])
print(c%2)

import bisect, collections
 
 
 
def solution():
    
    n = input().strip()

    if int(n[-1]) % 2 == 0:
        print("0")
    else:
        print("1")
    


    

def main():    
    # T = int(input().strip())
    for _ in range(1):
        solution()

def __starting_point():
    main()
__starting_point()

print(int(input()[-1]) % 2)


s = input()
print(int(s[-1])%2)

print(int(input()[-1]) % 2)

print(int(input()[-1]) % 2)

s = input()
print(int(s[-1])%2)

s = int(input()[-1])
if s % 2 == 0:
    print("0")
else:
    print("1")

print(int(input()[-1]) % 2)

n=input()
r=int(n[-1])
if r%2==0:
	print(0)
else:
	print(1)
	


n = input()

print(int(n[-1]) % 2)

n = int(input()[6])
print(n%2)


n = input()
b = n[1:]
bi = int(b)

if bi%2 == 0:
    print(0)
else:
    print(1)


def solution():
    s = input()
    if int(s[-1]) % 2 == 0:
        print(0)
    else:
        print(1)
solution()


n = int(input(), 16)
print(n % 2)


n = int(input()[1:])
if n % 2 == 0:
    print(0)
else:
    print(1)

hexa = input() 
if(int(hexa[-1])%2):
    print(1) 
else:
    print(0)

a = input()
c = int(a[-1])
print(c%2)

print(int(input()[-1]) % 2)


l = input()
if int(l[-1]) % 2 == 0:
    print(0)
else:
    print(1)

a = int(input(),16)
print(a%2)

print(int(input()[-1])%2)

"""
    Template written to be used by Python Programmers.
    Use at your own risk!!!!
    Owned by enraged(rating - 5 star at CodeChef and Specialist at Codeforces).
"""
import sys
from functools import lru_cache
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
# sys.setrecursionlimit(2*pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var): sys.stdout.write(str(var))
def outln(var): sys.stdout.write(str(var)+"\n")
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return list(map(int, data().split()))
def ssp(): return list(map(str, data().split()))
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


s = input()
s = s[1:]
print(int(s, 16) & 1)


a=input()
if int(a[-1]) % 2 == 0:
    print(0)
else:
    print(1)

s = input()

s= s[1:]
print(int(s) % 2)

print(int(input()[-1]) % 2)

print(int(input()[-1])%2)

s = input()
print(int(s[1:]) %2)

s = input()
print(int(s[-1]) % 2)

print(int(input()[1:])%2)

s = input()[1:]
print(int(s) % 2)

s = int(input(), 16)
print(s % 2)

n = input()
s = int(n, 16)
print(s&1)

n=input()
if(int(n[len(n)-1])%2==0):
    print("0")
else:
    print("1")

#!/usr/bin/env python3

a = input()
print(int(a[-1]) % 2)


##=====================================================
from sys import stdin, stdout
from collections import defaultdict
from functools import lru_cache
from math import gcd,floor,ceil

def ilist():
    return [int(x) for x in stdin.readline().strip().split(" ")]
def iint():
    return int(stdin.readline())
def istr():
    return stdin.readline().strip()
##=====================================================

s=istr()
print(int(s[-1])%2)
    
    


print(int(input()[1:])%2)



print(int(input()[-1])%2)

s=input()
if int(s[len(s)-1])%2==0:
	print("0")
else:
	print("1")

n = input()
k = int(n[-1])
if k%2 ==0:
	print("0")
else:
	print(1)


s = input()
i = int(s, 16)
print(i % 2)

a = int(input()[1:])

print(a % 2)


a = str(input())

if a[-1] in '02468ACE':
    print(0)
else:
    print(1)

s = input()
x = int(s, 16)
print(x%10%2)


s = input()[-1]
s = int(s) & 1
print(s)

i = input()

t = list(i)

last = int(t[-1])

print(last%2)

inp = list(input())
print(int(inp[6])%2)


def main_function():
    a = input()
    print(int(a[-1]) % 2)


def __starting_point():
    main_function()
__starting_point()

s=input()
print(int(s[-1])%2)

s = input()
print(int(s[-1]) % 2)