Finding CB numbers

import java.util.Scanner;
public class Main {
public static boolean cbnum(long n) {

	if(n==0||n==1){
		return false;
	}
	for(int i=2;i<=n/2;i++){
		if(n%i==0){
			return false;
		}
	}
	return true;
}

public static void main(String args[]) {

	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();
	scn.nextLine();
	String s = scn.nextLine();
	int start = 0, end = 1, count = 0;
	while (start < s.length()) {
		while (end <= s.length()) {
			long val = Long.parseLong(s.substring(start, end));
			if (cbnum(val)) {
				count++;
				start = end-1;
				break;

			} else {
				end++;
			}
		}
		start++;
		end = start + 1;
	}
	System.out.println(count);
}

}
0ut 0f 7 testcases 2 wernt wrong plz correct my code where i went wrong

Hey @karthik1989photos
try for this input
8
86922395
correct output : 4
your code gives : 2

i tried but i m not getting it,plz provide me the solution

@karthik1989photos