Chef Praveen likes acronyms a lot. He always uses them (his chat message vocabulary consists of LOL, BRB, ROFL etc.). So, he has decided that he wants to count the number of words that are acronyms in a chat message. However he is too lazy to code this simple program, so he tells you "Hey, write this program ASAP, I will BRB".
Formally a word is a acronym if:
- It has more than 1 character
- All its characters are upper case
Some examples of acronyms are: ICPC, LOL etc.
Some examples of words which are not acronyms are: The, A, hi etc.
The input consists of a single line: the chat message for which you have to count the acronyms.
Output a single number: the number of words in the input that are acronyms.
- There is only a single line
- The line will only contain alphabets (a to z, A to Z) and spaces to separate the words.
- The total number of characters in a line will be atleast 1 and atmost 1000.
Input: I like coding and will participate in IOI Then there is ICPC Output: 2
Example case 1. The words IOI and ICPC are acronyms, rest are not.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions