using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace cvrst_broj
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = Convert.ToInt64(Console.ReadLine());
            if (n % 10 == n / 100 && n % 10 != n % 100 / 10) Console.Write(1);
            else Console.Write(0);
            Console.ReadKey();
        }
    }
}