For this Question: Given an integer N, find the number of integers from 1 to N, that are odd as well as have odd number of digits, eg: 333 will be counted while 33 or 332 will not be counted.The first line and the only line of the input contains an integer N.

Constraints
1 <= N <= 100000Output a single integer, the number of integers that are odd as well as have odd number of digits in their decimal representation.Sample Input
13

Sample Output
5

Explanation: Only 1, 3, 5, 7, and 9 meet the criteria.

Sample Input
101

Sample Output
6, 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 cnt=0;
	  for(int i=1;i<=n;i++){
	      if(check(i)==1){
	          cnt++;
	      }
	  }
	  System.out.println(cnt);
	  

}
static int check(int i){
    if(i%2==0){return 0;}
    int cnt=0;
    while(i>0){
        i/=10;
        cnt++;
    }
    return cnt%2;
}


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