import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
public class Main
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
int n = str.length() / 2;
for(int i = 0; i < n; i++)
{
if(str.charAt(i) != str.charAt(str.length() - 1 - i))
{
System.out.print(0);
return;
}
}
System.out.print(1);
}
}