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 password) { int u=0,k=0,l=0,d=0,s=0; for(int i=0;i= 'A' && ch <= 'Z') u++; else if (ch >= 'a' && ch <= 'z') l++; else if (ch >= '0' && ch <= '9') d++; else s++; } if(u==0) k++; if(l==0) k++; if(s==0) k++; if(d==0) k++; if(n+k<6) k=k+(6-(n+k)); return k; } 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(); } }