def is_palindrome(num): num = '{:04}'.format(num) return int(num == num[::-1]) num = int(input()) print(is_palindrome(num))