2 otut of 9 test cases failed

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);
}

}

please tell what is going wrong???

hey @uttkarsh17goswami
Try for this Input:
8
86922395
correct output : 4

So what changes should i make in my code

Start checking from all the subarrays/substrings of smallest size i.e. 1 and then gradually increase the size.