@@ -0,0 +1,825 @@
+import java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0A%0Apublic class FifaGates %7B%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));%0A        int amountOfMoves = Integer.parseInt(reader.readLine());%0A        char%5B%5D moves = reader.readLine().toCharArray();%0A%0A        int x = 0;%0A        int y = 0;%0A        int toll = 0;%0A        for (int i = 0; i %3C amountOfMoves - 1; i++) %7B%0A            if (moves%5Bi%5D == 'R') %7B%0A                if (++x == y && moves%5Bi + 1%5D == 'R') %7B%0A                    toll++;%0A                %7D%0A            %7D else if (moves%5Bi%5D == 'U') %7B%0A                if (x == ++y && moves%5Bi + 1%5D == 'U') %7B%0A                    toll++;%0A                %7D%0A            %7D%0A        %7D%0A%0A        System.out.println(toll);%0A    %7D%0A%7D%09%0A%0A%0A

Add FifaGates