a = int(input())
result = abs(a) % 10
print(f'{result}')