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) { int count=0; int sl=0,cl=0,d=0,sc=0; for(int i=0;i='a' && ch<='z')sl++; else if(ch>='A' && ch<='Z')cl++; else if(ch>='0'&&ch<='9')d++; else sc++; } if(sl==0)count++; if(cl == 0)count++; if(d==0)count++; if(sc==0)count++; n = n + count; if(n<6) count = count + (6 - n) ; return count; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String p = in.next(); int answer = minimumNumber(n, p); System.out.println(answer); in.close(); } }