#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<limits.h>

#define MAX_TITLE_LEN 10

void reverseString(char *str){
    int len=strlen(str);
    char *start=str;
    char *end=str+len-1;
    while(start<end){
        char temp=*start;
        *start=*end;
        *end=temp;
        start++;
        end--;
    }
}
int main(){
    char inputBuffer[20];
    long n_long;
    int n;
    char *endptr;
    if(fgets(inputBuffer,sizeof(inputBufffer),stdin)==NULL){
        printf("Invalid input");
        return 1;
    }
    inputBuffer[strcspn(inputBuffer,"\n")]=0;
    n_long=strtol(inputBuffer,&endptr,10);
    
    if(endptr==inputBuffer || *endptr!='\0'){
        printf("Invalid input");
        return 0;
    }
    if(n_long<=0 || n_long>INT_MAX){
        printf("Invalid input");
        return 0;
    }
    n=(int)n_long;
}