import java.util.Scanner; import java.util.regex.Pattern; /** * Created by Prateek on 11/2/2017. */ public class One { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = sc.next(); Pattern pnum = Pattern.compile("[\\d]"); Pattern pa = Pattern.compile("[a-z]"); Pattern pA = Pattern.compile("[A-Z]"); Pattern ps = Pattern.compile("[^A-Za-z0-9]"); int count=0; if(pnum.matcher(s).find()==false){ count++; } if(pa.matcher(s).find()==false){ count++; } if(pA.matcher(s).find()==false){ count++; } if(ps.matcher(s).find()==false){ count++; } if(s.length()+count<6){ int diff = 6-count-s.length(); count+=diff; } System.out.println(count); } }