uses math; var s:string; n:longint; l_c,u_c,nu,sc:0..1; procedure process; var d,i:longint; begin D:=0; for i:=1 to n do begin if (s[i] in ['A'..'Z']) then u_c:=1 else if (s[i] in ['0'..'9']) then nu:=1 else if (s[i] in ['a'..'z']) then l_c:=1 else sc:=1; end; if (u_c=0) then inc(d); if (l_c=0) then inc(d); if (nu=0) then inc (d); if (sc=0) then inc(d); if (n+d<6) then d:=d+6-(n+d); write(d); end; begin readln(n); read(s); process; end.