Limits 1s, 512 MB

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?

Input

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.

Output

For each string print number of passwords Alice can extract from it.

Sample

InputOutput
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.

Submit

Login to submit.

Statistics

89% Solution Ratio
musa.cse12Earliest, Aug '15
Reayz77Fastest, 0.0s
HillolTalukdarLightest, 0 B
saitotaShortest, 52B
Toph uses cookies. By continuing you agree to our Cookie Policy.