using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static int minimumNumber(int n, string password) { string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; int types = 0; if (ContainsAny(password, numbers)) types++; if (ContainsAny(password, lower_case)) types++; if (ContainsAny(password, upper_case)) types++; if (ContainsAny(password, special_characters)) types++; //Console.Error.WriteLine((6 - n) + " " + (4 - types)); return Math.Max(Math.Max(6 - n, 0), 4 - types); } static bool ContainsAny(string a, string b) { foreach (char c in b) { if (a.IndexOf(c) > -1) { return true; } } return false; } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string password = Console.ReadLine(); int answer = minimumNumber(n, password); Console.WriteLine(answer); } }