#include<stdio.h>
#include<string.h>
int ispalindrome(char *str){
    int size = strlen(str);
    char *start = str;
   char *end = str +size - 1;
   while (start < end){
       if(*str)
   }
            return 0;
        }
        start++;
        //end--;
  //  return 1;
//}
int main(){
    int n;
    //printf("Enter the maximum length of the string: ");
    if (scanf("%d", &n) != 1 || n <= 0){
        printf("Invalid Input\n");
        return 1;
    }
    while (getchar() != '\n');
  //  printf("Enter a string (up to %d character): ",n);
    char str[n + 1];
    if(fgets(str, sizeof(str), stdin) == NULL){
        printf("Error reading string\n");
        return 1;
    }
    str[strcspn(str, "\n")] = ' ';
    int result = ispalindrome(str);
    printf("%d\n", result);
    return 0;
}