import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int minimumNumber(int n, String p) { boolean d = false; boolean l = false; boolean u = false; boolean s = false; String sp = "!@#$%^&*()-+"; for(int i=0;i= '0' && ch <= '9'){ d = true; }else if(ch >= 'a' && ch <= 'z'){ l = true; } else if(ch >= 'A' && ch <= 'Z'){ u = true; } else if(sp.contains(ch+"")){ s = true; } } int cnt = 0; if(!d){ cnt++; } if(!l){ cnt++; } if(!u){ cnt++; } if(!s){ cnt++; } while(n+cnt<6){ cnt++; } return cnt; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String password = in.next(); int answer = minimumNumber(n, password); System.out.println(answer); in.close(); } }