Language: C++

using System;
using System.Collections.Generic;

class Program
{
	static private List<int> PrimeList;

	static private int Max()
	{
		int max = 0;
		foreach(int n in PrimeList)
			if(n > max) max = n;

		return max;
	}

	static private bool Prime(int n)
	{
		if(n == 1) return false;
		if(PrimeList.Contains(n)) return true;

		bool a = true;
		foreach(int p in PrimeList)
		{
			if(p > n/2) break;
			if(n%p == 0)
			{
				a = false;
				break;
			}
		}
		if(a == false) return a;

		int max = Max();
		if(max < n / 2)
		{
			for(int i=max+1; i<n/2; i++)
			{
				bool isprime = true;
				foreach(int p in Primelist)
				{
					if(i%p == 0) isprime = false;
				}
				if(isprime)
				{
					Primelist.Add(i);
					if(n%i == 0)
					{
						a = false;
						break;
					}
				}
			}
		}
		return a;
	}

	static void Main() 
	{
		PrimeList = new List<int>();
		PrimeList.Add(2);
		int num = int.Parse(Console.ReadLine());

		int n = 0;
		for(int i=0; i<num; i++)
		{
			if(Prime(int.Parse(Console.ReadLine())))
				n++;
		}
		Console.WriteLine(n.ToString() + "\n");
	}
}

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.Generic;
      |       ^~~~~~
a.cc:6:16: error: expected unqualified-id before 'private'
    6 |         static private List<int> PrimeList;
      |                ^~~~~~~
a.cc:8:16: error: expected unqualified-id before 'private'
    8 |         static private int Max()
      |                ^~~~~~~
a.cc:17:16: error: expected unqualified-id before 'private'
   17 |         static private bool Prime(int n)
      |                ^~~~~~~
a.cc:72:2: error: expected ';' after class definition
   72 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:60:17: error: 'PrimeList' was not declared in this scope
   60 |                 PrimeList = new List<int>();
      |                 ^~~~~~~~~
a.cc:60:33: error: 'List' does not name a type
   60 |                 PrimeList = new List<int>();
      |                                 ^~~~
a.cc:60:38: error: expected primary-expression before 'int'
   60 |                 PrimeList = new List<int>();
      |                                      ^~~
a.cc:62:27: error: expected primary-expression before 'int'
   62 |                 int num = int.Parse(Console.ReadLine());
      |                           ^~~
a.cc:67:34: error: expected primary-expression before 'int'
   67 |                         if(Prime(int.Parse(Console.ReadLine())))
      |                                  ^~~
a.cc:67:28: error: 'Prime' was not declared in this scope
   67 |                         if(Prime(int.Parse(Console.ReadLine())))
      |                            ^~~~~
a.cc:70:17: error: 'Console' was not declared in this scope
   70 |                 Console.WriteLine(n.ToString() + "\n");
      |                 ^~~~~~~
a.cc:70:37: error: request for member 'ToString' in 'n', which is of non-class type 'int'
   70 |                 Console.WriteLine(n.ToString() + "\n");
      |                                     ^~~~~~~~