For this Question: Given a string S. A string is called good if it is a prefix of string S. A string is called well if it is of even length and can be divided into two equal sub-strings of equal length. Find number of sub-strings which are both good and well.First line contains a string S.

Constraints
1<=|S|<=100000
String S can contain char (a-z, A-Z), or one digit integers (0-9).Print the answer.Sample Input
aacaacc

Sample Output
2

Explanation
aa, aacaac are two substrings

Sample Input
1111

Sample Output
2, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args)throws IOException {



           BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         String str = br.readLine();

            int count=0;

            int mid;
            boolean flag=true;

            if(str.length() >=2){
                 for(int i=0,j=1;j<str.length();j+=2){
                      mid=(j+1)/2;
                      flag=true;




                      for(int l=0,m=mid;i<mid && m<j+1;l++,m++){
                           if(str.charAt(l)!=str.charAt(m)){
                                flag=false;
                                break;
                           }
                      }
                      if(flag){
                           ++count;
                      }
                 }
            }



          System.out.println(count);

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