For this Question: Given a number n find the number of prime numbers less than equal to that number.There is only one integer containing value of n.

Constraints:-
1 <= n <= 10000000Return number of primes less than or equal to nSample Input
5

Sample Output
3

Explanation:-
2 3 and 5 are the required primes.

Sample Input
5000

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



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

                      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                      long n = Integer.parseInt(br.readLine());



                      long i=2,j,count,noOfPrime=0;
                      if(n<=1)
                          System.out.println("0");
                      else{
                      while(i<=n)
                      {
                            count=0;
                            for(j=2; j<=Math.sqrt(i); j++)
                            {
                                  if( i%j == 0 ){
                                     count++;
                                     break;
                                  }
                            }
                            if(count==0){
                                noOfPrime++;
                            }
                            i++;
                      }
                      System.out.println(noOfPrime);
	                    }
      }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?