import java.util.Scanner; class OneHourRank24 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String password = sc.next(); char a[] = password.toCharArray(); int len = password.length(); boolean check[] = new boolean[4]; for(int i=0; i<4; i++) { check[i] = false; } for(int i=0; i= 97 && (int)a[i] <= 122) { check[0] = true; } else if((int)a[i] >= 65 && (int)a[i] <= 90) { check[1] = true; } else if((int)a[i] >= 48 && (int)a[i] <= 57) { check[2] = true; } else { check[3] = true; } } int count = 0; for(int i=0; i<4; i++) { if(check[i] == false) { count++; } } if(len + count <= 6) { System.out.println(6-len); } else { System.out.println(count); } } }