using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; bool nu = false; bool lo = false; bool up = false; bool sp = false; int cnt = 0; for(int i = 0; i < numbers.Length; i++){ nu = password.Contains(numbers[i]); if(nu) break; } for(int i = 0; i < lower_case.Length; i++){ lo = password.Contains(lower_case[i]); if(lo) break; } for(int i = 0; i < upper_case.Length; i++){ up = password.Contains(upper_case[i]); if(up) break; } for(int i = 0; i < special_characters.Length; i++){ sp = password.Contains(special_characters[i]); if(sp) break; } if(nu == false) cnt++; if(lo == false) cnt++; if(up == false) cnt++; if(sp == false) cnt++; if(6 - n < cnt){ return cnt; }else{ return 6 - n; } } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string password = Console.ReadLine(); int answer = minimumNumber(n, password); Console.WriteLine(answer); } }