Alice wants to extract some passwords from a random string. A password can have any number of characters but it must contain at least one lowercase letter, one uppercase letter and a digit. She is looking at the string from left to right, and whenever she thinks she got a new password, she stores it in her database and starts checking from next character.
Given the string, can you determine how many passwords Alice will be able to extract from it?
Each line will contain a string consisting only english alphabets and digits. The length of the string will be between 1 and 100. Read input till EOF.
For each string print number of passwords Alice can extract from it.
hello1World2X aBAb222abD32Gggp aasdafsdfDSF
2 3 0
In the first case, the extracted passwords are “hello1W” and “orld2X”
In the second case, the extracted passwords are “aBAb2”, “22abD”,”32Gg”
In the third case there are no digits, so no password can be extracted.