// editor2
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
    char s[100];
    if(fgets(s,sizeof(s),stdin)==NULL) {
        return 0;
    }
    size_t i len=strlen(s);
    if(len>0 && s[len-1]=='\n')
    {
        s[len-1]='\0';
        len--;
    }
    for(size_t=0;i<len;i++)
    {
        if(!(isalpha(s[i]) || isspace(s[i])))
        {
            printf("Invalid Input");
            return 0;
        }
    }
    chat*token=stroke(s," ");
    char lastword[100]="";
    while(token!=NULL) {
        strcpy(lastword,token);
        token=strtok(NULL," ");
    }
    printf("%lu",strlen(lastword));
    return 0;
}