import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
int n = cin.nextInt(),count = 0;
String str = cin.next();
for(int i = 0;i<str.length();i++){
for(int j = i+1;j<=str.length();j++){
int x = Integer.parseInt(str.substring(i,j));
if(isValid(x)){
count++;
}
}
}
System.out.print(count);
}
public static boolean isValid(int y){
int arr[] = {2,3,5,7,11,13,17,19,23};
if(y==0||y==1){
return false;
}
for(int i = 0;i<arr.length;i++){
if(y == arr[i]){
return true;
}
}
for(int i = 0;i<arr.length;i++){
if(y%arr[i] == 0){
return false;
}
}
return true;
}
} =====I have found that for eg in sample input 5 81615 , I m also counting 615 along with 61 and 5 , please tell how to remove that by editing my code