Language: C++

using System;
using System.Collections;

class main
{
    static void Main(String[] args)
    {
        while (true)
        {
            string s = Console.ReadLine();           
            if (s != null)
            {
                int c = 0;
                int f = 0;
                int n = int.Parse(s);
                int r = (int)Math.Sqrt(n);
                ArrayList  p = new ArrayList();
                if (n > 1)
                {
                    for (int a = 2; a <= n; a++)
                    {
                        p.Add(a);
                    }
                    while (true)
                    {
                        f = (int)p[0];
                        c++;
                        for (int i = 0; i < n; i++)
                        {
                            p.Remove(f * i);
                        }
                        if (f > r)
                        {
                            break;
                        }
                    }
                    Console.WriteLine("{0}",c+p.Count);
                }
                if (n <= 1)
                {
                    Console.WriteLine(0);
                }
            }
            if (s == null)
            {
                break;
            }
        }
        Console.ReadKey();
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections;
      |       ^~~~~~
a.cc:6:22: error: 'String' has not been declared
    6 |     static void Main(String[] args)
      |                      ^~~~~~
a.cc:6:31: error: expected ',' or '...' before 'args'
    6 |     static void Main(String[] args)
      |                               ^~~~
a.cc:51:2: error: expected ';' after class definition
   51 | }
      |  ^
      |  ;
a.cc: In static member function 'static void main::Main(int*)':
a.cc:10:13: error: 'string' was not declared in this scope
   10 |             string s = Console.ReadLine();
      |             ^~~~~~
a.cc:11:17: error: 's' was not declared in this scope
   11 |             if (s != null)
      |                 ^
a.cc:11:22: error: 'null' was not declared in this scope
   11 |             if (s != null)
      |                      ^~~~
a.cc:15:25: error: expected primary-expression before 'int'
   15 |                 int n = int.Parse(s);
      |                         ^~~
a.cc:16:30: error: 'Math' was not declared in this scope
   16 |                 int r = (int)Math.Sqrt(n);
      |                              ^~~~
a.cc:17:17: error: 'ArrayList' was not declared in this scope
   17 |                 ArrayList  p = new ArrayList();
      |                 ^~~~~~~~~
a.cc:22:25: error: 'p' was not declared in this scope
   22 |                         p.Add(a);
      |                         ^
a.cc:26:34: error: 'p' was not declared in this scope
   26 |                         f = (int)p[0];
      |                                  ^
a.cc:37:21: error: 'Console' was not declared in this scope
   37 |                     Console.WriteLine("{0}",c+p.Count);
      |                     ^~~~~~~
a.cc:37:47: error: 'p' was not declared in this scope
   37 |                     Console.WriteLine("{0}",c+p.Count);
      |                                               ^
a.cc:41:21: error: 'Console' was not declared in this scope
   41 |                     Console.WriteLine(0);
      |                     ^~~~~~~
a.cc:44:17: error: 's' was not declared in this scope
   44 |             if (s == null)
      |                 ^
a.cc:44:22: error: 'null' was not declared in this scope
   44 |             if (s == null)
      |                      ^~~~
a.cc:49:9: error: 'Console' was not declared in this scope
   49 |         Console.ReadKey();
      |         ^~~~~~~