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) { // Return the minimum number of characters to make the password strong boolean num=false; boolean special=false; boolean upper=false; boolean lower=false; int count=0; int req=0; for(int i=0;i=65&&temp<=90){ upper=true; } else if(temp>=97&&temp<=122){ lower=true; } else if(temp>=48&&temp<=57){ num=true; } else special=true; } if(!upper){ req++; } if(!lower){ req++; } if(!num){ req++; } if(!special){ req++; } if(req==0){ if(count>=6) return 0; else return 6-count; } else { if(count+req>=6){ return req; } else return (6-count); } } 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(); } }