#include <stdio.h> #include <ctype.h> #define LEN 250 int main() { char s[LEN]; while (fgets(s, sizeof(s), stdin) != NULL) { int count = 0; for(int i = 0; s[i] != '\n' && s[i] != '\0'; i++) { if(isupper(s[i])) count++; } printf("%d\n", count); } return 0; }