Make it Strong

5

1 votes
Easy
Problem

You're creating a new site and the signup page requires users to input the username and password, Since you're concerned about the security of your users, you've planned to setup a strong password. You've requested help from Adrian Lamo - the famous hacker and he sends you the following criteria for a password to be strong.

  • Its length is at least 6.
  • It contains at least one digit.
  • It contains at least one lowercase English character.
  • It contains at least one uppercase English character.
  • It contains at least one special character. The special characters are: !@#$%^&*()-+

A user typed a random string in the password field but wasn't sure if it was strong. Given the string he/she typed, can you find the minimum number of characters he/she must add to make the password strong?

 

Sample Input :

Hai9

Sample Output :

2

Explanation :

The user can make the password strong by adding 2 charcters, for example @o, converting the password to Hai9@o which is strong. 1 Special Character isn't enough since the length must be atleast 6.

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?