package main import "fmt" import "io/ioutil" import "math" import "os" import "strings" func main() { N := ScanInt(1, 100) NewLine() p := ScanString(N, N) var num, lower, upper, special bool for i := 0; i < len(p); i++ { c := p[i] if '0' <= c && c <= '9' { num = true } else if 'a' <= c && c <= 'z' { lower = true } else if 'A' <= c && c <= 'Z' { upper = true } } special = strings.IndexAny(p, "!@#$%^&*()-+") >= 0 need := 0 if !num { need++ } if !lower { need++ } if !upper { need++ } if !special { need++ } if len(p) + need < 6 { need = 6 - len(p) } fmt.Println(need) } func NewLine() { if CheckInput { for n, b := range RemainingInput { if b != ' ' && b != '\t' && b != '\r' { Assert(b == '\n') RemainingInput = RemainingInput[n+1:] return } } Assert(false) } } func ScanInt(low, high int) int { return int(ScanInt64(int64(low), int64(high))) } func ScanString(short, long int) string { return string(ScanBytes(short, long)) } func Assert(condition bool) { if !condition { panic("assertion failed") } } var RemainingInput []byte func init() { var e error RemainingInput, e = ioutil.ReadAll(os.Stdin) if e != nil { panic(e) } } func ScanInt64(low, high int64) int64 { x := Btoi(ScanToken()) Assert(low <= x && x <= high || !CheckInput) return x } func ScanBytes(short, long int) []byte { token := ScanToken() Assert(short <= len(token) && len(token) <= long) return token } func Btoi(s []byte) int64 { if s[0] == '-' { x := Btou(s[1:]) Assert(x <= - math.MinInt64) return - int64(x) } else { x := Btou(s) Assert(x <= math.MaxInt64) return int64(x) } } var CheckInput = true func ScanToken() []byte { for n, b := range RemainingInput { if b == ' ' || b == '\t' || b == '\r' { continue } if b == '\n' { Assert(!CheckInput) continue } RemainingInput = RemainingInput[n:] break } Assert(len(RemainingInput) > 0) n := 1 for ; n < len(RemainingInput); n++ { b := RemainingInput[n] if b == ' ' || b == '\t' || b == '\r' || b == '\n' { break } } token := RemainingInput[:n] RemainingInput = RemainingInput[n:] return token } func Btou(s []byte) uint64 { Assert(len(s) > 0) var x uint64 for _, d := range s { Assert('0' <= d && d <= '9') d -= '0' if x >= math.MaxUint64 / 10 { Assert(x == math.MaxUint64 / 10 && d <= math.MaxUint64 % 10) } x = x * 10 + uint64(d) } return x }