Language: C++

import java.util.*;
import java.io.*;

class Main
{
	public static void main(String[] args)
	{
		Boorean[] bit = new Boorean[1000000];
		Arrays.fill(bit, true);
		bit[0] = false;
		bit[1] = false;

		for(int i=2; i<1000; ++i){
			if(bit[i]){
				for(int j=i*2; j<1000000; j+=i)
					bit[j] = false;
			}
		}

		int[] prime = new int[1000000];
		prime[0] = 0;
		for(int i=1; i<1000000; ++i)
			prime[i] = prime[i-1] + (bit[i] ? 1 : 0);

		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String str;
		try{
			while((str = bf.readLine()) != null){
				int n = Integer.parseInt(str);
				System.out.println(prime[n]);
			}
		}
		catch(IOException ex){
			System.out.println(ex);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main(String[] args)
      |               ^~~~~~~
      |               :
a.cc:6:33: error: 'String' has not been declared
    6 |         public static void main(String[] args)
      |                                 ^~~~~~
a.cc:6:42: error: expected ',' or '...' before 'args'
    6 |         public static void main(String[] args)
      |                                          ^~~~
a.cc:37:2: error: expected ';' after class definition
   37 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:8:17: error: 'Boorean' was not declared in this scope
    8 |                 Boorean[] bit = new Boorean[1000000];
      |                 ^~~~~~~
a.cc:8:25: error: expected primary-expression before ']' token
    8 |                 Boorean[] bit = new Boorean[1000000];
      |                         ^
a.cc:9:17: error: 'Arrays' was not declared in this scope
    9 |                 Arrays.fill(bit, true);
      |                 ^~~~~~
a.cc:9:29: error: 'bit' was not declared in this scope
    9 |                 Arrays.fill(bit, true);
      |                             ^~~
a.cc:20:20: error: structured binding declaration cannot have type 'int'
   20 |                 int[] prime = new int[1000000];
      |                    ^~
a.cc:20:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:20:20: error: empty structured binding declaration
a.cc:20:23: error: expected initializer before 'prime'
   20 |                 int[] prime = new int[1000000];
      |                       ^~~~~
a.cc:21:17: error: 'prime' was not declared in this scope
   21 |                 prime[0] = 0;
      |                 ^~~~~
a.cc:25:17: error: 'BufferedReader' was not declared in this scope
   25 |                 BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
      |                 ^~~~~~~~~~~~~~
a.cc:26:17: error: 'String' was not declared in this scope
   26 |                 String str;
      |                 ^~~~~~
a.cc:28:32: error: 'str' was not declared in this scope; did you mean 'std'?
   28 |                         while((str = bf.readLine()) != null){
      |                                ^~~
      |                                std
a.cc:28:38: error: 'bf' was not declared in this scope
   28 |                         while((str = bf.readLine()) != null){
      |                                      ^~
a.cc:28:56: error: 'null' was not declared in this scope
   28 |                         while((str = bf.readLine()) != null){
      |                                                        ^~~~
a.cc:29:41: error: 'Integer' was not declared in this scope
   29 |                                 int n = Integer.parseInt(str);
      |                                         ^~~~~~~
a.cc:30:33: error: 'System' was not declared in this scope
   30 |                                 System.out.println(prime[n]);
      |                                 ^~~~~~
a.cc:33:23: error: 'IOException' does not name a type
   33 |                 catch(IOException ex){
      |                       ^~~~~~~~~~~
a.cc:34:25: error: 'System' was not declared in this scope
   34 |                         System.out.println(ex);
      |                         ^~~~~~
a.cc:34:44: error: 'ex' was not declared in this scope
   34 |                         System.out.println(ex);
      |                                            ^~