For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.

See the below example for a better understandingFirst line of input contains two space- separated integers N and M. Next N lines of input contain M space- separated integers depicting the values of the matrix.

Constraints:-
3 <= N, M <= 500
0 <= Matrix[][] <= 1Print the number of good cells.Sample Input:-
3 3
1 1 0
1 1 1
1 1 1

Sample Output:-
1

Explanation:- 
Only cell at position 1, 1 is good

Sample Input:-
5 4
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1
1 0 1 0

Sample Output:-
3

Explanation:-
(1, 2), (2, 1) and (3, 2) are good cells, I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
int m= sc.nextInt();
   int a[][]= new int[n][m];
  for(int i=0;i<n;i++){
      for(int j=0;j<m;j++){
   a[i][j]=sc.nextInt();}}
   int cnt=0;
  for(int i=1;i<n-1;i++){
  for(int j=1;j<m-1;j++){
  if(a[i-1][j]==1 && a[i+1][j]==1 && a[i][j-1]==1 && a[i][j+1]==1){
    cnt++;
  }
  }
  }
  System.out.print(cnt);
}

   }
	    


, In this Programming Language: Java, Now tell me if this Code is compilable or not?