Language: C++

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;class Program
{
	static void Main(string[] args)
	{
        //var exStdIn = new System.IO.StreamReader( "stdin.txt" );System.Console.SetIn( exStdIn );
		int n = int.Parse(Console.ReadLine());
		string s = Console.ReadLine();
		int l = 0, r = n-1;
		int ans = 0;
		while(true){
			while(l<n&&s[l]=='R')l++;
			while(0<r&&s[r]=='W')r--;
			if(r<=l)break;
			ans++;
			l++;r--;
		}
		Console.WriteLine(ans);
	}
	
}


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:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Diagnostics;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.IO;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Linq;
      |       ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'System'
    7 | using System.Numerics;
      |       ^~~~~~
a.cc:8:7: error: expected nested-name-specifier before 'System'
    8 | using System.Text;
      |       ^~~~~~
a.cc:9:7: error: expected nested-name-specifier before 'System'
    9 | using System.Text.RegularExpressions;
      |       ^~~~~~
a.cc:10:7: error: expected nested-name-specifier before 'System'
   10 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:7: error: expected nested-name-specifier before 'static'
   11 | using static System.Math;class Program
      |       ^~~~~~
a.cc:13:26: error: 'string' has not been declared
   13 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:13:35: error: expected ',' or '...' before 'args'
   13 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:30:2: error: expected ';' after class definition
   30 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:16:25: error: expected primary-expression before 'int'
   16 |                 int n = int.Parse(Console.ReadLine());
      |                         ^~~
a.cc:17:17: error: 'string' was not declared in this scope
   17 |                 string s = Console.ReadLine();
      |                 ^~~~~~
a.cc:21:36: error: 's' was not declared in this scope
   21 |                         while(l<n&&s[l]=='R')l++;
      |                                    ^
a.cc:22:36: error: 's' was not declared in this scope
   22 |                         while(0<r&&s[r]=='W')r--;
      |                                    ^
a.cc:27:17: error: 'Console' was not declared in this scope
   27 |                 Console.WriteLine(ans);
      |                 ^~~~~~~