#include <stdio.h>
#include <string.h>
#include <ctype.h>

void find_last_word_length(const char *s){
    for (int i = 0; s[i]; i++){
        if (!isalpha(s[i]) && !isspace(s[i])) {
            printf("Ivalid input\n");
            return;
        }
    }
    int length = strlen(s);
    int count = 0;
    int i = length - 1;
    while (i >= 0 && isspace(s[i])) i--;
    while (i >= 0 && !isspace(s[i])) {
        i--;
    }
    printf("%\n", count);
}
int main() {
    cnar s[21];
    printf("Enter a string: ");
    fgets(s, sizeof(s), stdin);
    s[strcspn(s, "\n")] = 0;
    find_last_word_length(s);
    return 0:
}