#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<stdbool.h>
bool isInteger(const char*str){
    while(*str ==''){
        str++;
    }
    if(*str == '\0'){
        return false;
    }
    while(*str!='\0'){
        if(!isdigit(*str) && *str !=''){
            return false;
        }
        str++;
    }
    return true;
}
int countValidChars(const char*title){
    int count=0;
    for(int i = 0; title[i] != '\0'; i++){
        if (isalpha(title[i])){
            count++;
        }
    }
    return count;
}
int main(){
    char title[1000];
    
    if(fgets(title,sizeof(title), stdin) == NULL){
        printf("Invalid input\n");
        return 1;
    }
    size_t len = strlen(title);
    if(len > 0 && title[len - 1] == '\n'){
        title[len-1]='\0';
    }
    if(strlen(title)==0){
        printf("Invalid input\n");
        
    }else{
        int charCount=countValidChars(title);
        printf("%d\n",charCount);
    }
    return 0;
}