Ivan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell (0, 0). The robot can process commands. There are four types of commands it can perform:

  * U — move from the cell (x, y) to (x, y + 1); 
  * D — move from (x, y) to (x, y - 1); 
  * L — move from (x, y) to (x - 1, y); 
  * R — move from (x, y) to (x + 1, y). 



Ivan entered a sequence of n commands, and the robot processed it. After this sequence the robot ended up in the starting cell (0, 0), but Ivan doubts that the sequence is such that after performing it correctly the robot ends up in the same cell. He thinks that some commands were ignored by robot. To acknowledge whether the robot is severely bugged, he needs to calculate the maximum possible number of commands that were performed correctly. Help Ivan to do the calculations!

Input

The first line contains one number n — the length of sequence of commands entered by Ivan (1 ≤ n ≤ 100).

The second line contains the sequence itself — a string consisting of n characters. Each character can be U, D, L or R.

Output

Print the maximum possible number of commands from the sequence the robot could perform to end up in the starting cell.

Examples

Input

4
LDUR


Output

4


Input

5
RRRUU


Output

0


Input

6
LLRRRR


Output

4
import java.io.*;

public class P888B {
    private static class HpReader {
        private BufferedReader in;
        private String containingDirPath;

        public HpReader(String dir, String inFile, String outFile) {
            initAndRedirectInOut(dir, inFile, outFile);
        }

        private static int ivl(String val) {
            return Integer.parseInt(val);
        }

        private void initAndRedirectInOut(String dir, String inFile, String outFile) {
            if (dir != null) {
                try {
                    containingDirPath = dir.endsWith(File.separator) ? dir : dir + File.separator;
                    if (isDebug && inFile != null) System.setIn(new FileInputStream(new File(containingDirPath + inFile)));
                    if (isDebug && outFile != null) System.setOut(new PrintStream(new File(containingDirPath + outFile)));
                } catch (FileNotFoundException e) {
                    // Do nothing, stdin & stdout are not redirected
                }
            }
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }

        private String nextSingleStr() throws IOException {
            return in.readLine();
        }

        private String[] nextLineStr() throws IOException {
            return nextLineStr(0);
        }

        private String[] nextLineStr(int offset) throws IOException {
            String[] inp = nextSingleStr().split(" ");
            String[] rs = new String[offset + inp.length];
            System.arraycopy(inp, 0, rs, offset, inp.length);
            return rs;
        }

        private int nextSingleInt() throws IOException {
            return ivl(in.readLine());
        }

        private int[] nextLineInt() throws IOException {
            return nextLineInt(0);
        }

        private int[] nextLineInt(int offset) throws IOException {
            String[] inp = nextLineStr();
            int[] rs = new int[offset + inp.length];
            for (int i = 0; i < inp.length; i++) rs[offset + i] = ivl(inp[i]);
            return rs;
        }

        private int[][] nextMatInt(int lineCount) throws IOException {
            return nextMatInt(lineCount, 0, 0);
        }

        private int[][] nextMatInt(int lineCount, int rowOffset, int colOffset) throws IOException {
            int[][] rs = new int[rowOffset + lineCount][];
            for (int i = rowOffset; i < rs.length; i++) rs[i] = nextLineInt(colOffset);
            return rs;
        }
    }

    private static class HpHelper {
        private static final String LOCAL_DEBUG_FLAG = "COM_PROG_DEBUG";

        private static boolean isDebug() {
            try {
                return Boolean.parseBoolean(System.getenv(HpHelper.LOCAL_DEBUG_FLAG));
            } catch (Exception e) {
                return false;
            }
        }

        private static String createDelimiter(String delimiter) {
            return delimiter == null ? " " : delimiter;
        }

        private static void println(int[] data, String delimiter) {
            delimiter = createDelimiter(delimiter);
            for (int t : data) out.print(t + delimiter);
            out.println();
        }

        private static void println(long[] data, String delimiter) {
            delimiter = createDelimiter(delimiter);
            for (long t : data) out.print(t + delimiter);
            out.println();
        }

        private static <T> void println(T[] data, String delimiter) {
            delimiter = createDelimiter(delimiter);
            for (T t : data) {
                if (t instanceof int[]) {
                    println((int[]) t, delimiter);
                } else if (t instanceof long[]) {
                    println((long[]) t, delimiter);
                } else if (t instanceof Object[]) {
                    println((Object[]) t, delimiter);
                } else {
                    out.print(t + delimiter);
                }
            }
            out.println();
        }
    }

    private static boolean isDebug = HpHelper.isDebug();
    private static HpReader in = new HpReader("/Users/apple/Work/WorkSpaces/CompetitiveProg/", "in.txt", null);
    private static PrintWriter out;

    public static void main(String[] args) throws IOException {
        int n = in.nextSingleInt(), u = 0, d = 0, l = 0, r = 0;
        String s = in.in.readLine();
        for (char c : s.toCharArray()) {
            u += (c == 'U' ? 1 : 0);
            d += (c == 'D' ? 1 : 0);
            l += (c == 'L' ? 1 : 0);
            r += (c == 'R' ? 1 : 0);
        }
        int m1 = Math.min(u, d), m2 = Math.min(l, r);
        out.println((m1 + m2) * 2);

        out.flush();
    }
}
