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.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	static BufferedReader br;
    static StringTokenizer sc;
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        //br = new BufferedReader(new FileReader("input.in"));
        br = new BufferedReader(new InputStreamReader(System.in));
        //out = new PrintWriter("output.out");
        out = new PrintWriter(System.out);
        sc = new StringTokenizer("");
/******************** Solution ******************************/
        int n = nxtInt();
		String str = nxtTok();
		int u = 0, d = 0, l = 0, r = 0;
		
		for (int i = 0; i < n; i++) {
			char ch = str.charAt(i);
			if (ch == 'U')
				u++;
			if (ch == 'D')
				d++;
			if (ch == 'R')
				r++;
			if (ch == 'L')
				l++;
		}
		
		out.println("" + 2 * (Math.min(u, d) + Math.min(l, r)));
/******************** Solution ******************************/
        br.close();
        out.close();
        //System.out.println("Finished");
    }    
    
    static int getQuality(int number, int best) {
    	int q = 0;
    	number++;
    	int div = 1;
    	for (int i = 0; i < best; i++)
    		div *= 10;
    	if (number % div == 0) {
    		q = best;
    		number = number / div;
    	}
    	boolean ok = true;
    	    	
    	while (ok) {
    		if (number % 10 == 0) {
    			q++;
    			number = number / 10;
    		}
    		else
    			ok = false;
    	}
    	
    	return q;
    }

    static String nxtTok() throws IOException {
        while (!sc.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            sc = new StringTokenizer(s.trim());
        }
        return sc.nextToken();
    }

    static int nxtInt() throws IOException {
        return Integer.parseInt(nxtTok());
    }

    static long nxtLng() throws IOException {
        return Long.parseLong(nxtTok());
    }

    static double nxtDbl() throws IOException {
        return Double.parseDouble(nxtTok());
    }

    static int[] nxtIntArr(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nxtInt();
        }
        return a;
    }

    static long[] nxtLngArr(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = nxtLng();
        }
        return a;
    }

    static char[] nxtCharArr() throws IOException {
        return nxtTok().toCharArray();
    }
    
    static int getMin(int arr[], int count)
    {
    	int min = arr[0];
    	for (int i = 1; i < count; i++)
    		if (arr[i] < min)
    			min = arr[i];

    	return min;
    }

    static int getMax(int arr[], int count)
    {
    	int max = arr[0];
    	for (int i = 1; i < count; i++)
    		if (arr[i] > max)
    			max = arr[i];

    	return max;
    }

    static void sortAsc(int arr[], int count)
    {
        int temp;

        for (int i = 0; i < count - 1; i++)
        {
            for (int j = i + 1; j < count; j++)
            {
                if (arr[i] > arr[j])
                {
                    temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
    }

    static void sortDesc(String[] names, int[] arr, int count)
    {
        int temp;
        String tempName;

        for (int i = 0; i < count - 1; i++)
        {
            for (int j = i + 1; j < count; j++)
            {
                if (arr[i] < arr[j])
                {
                    temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                    
                    tempName = names[i];
                    names[i] = names[j];
                    names[j] = tempName;
                } else if (arr[i] == arr[j]) {
                	int shorter = names[i].length() < names[j].length() ? names[i].length() : names[j].length();
                	boolean swap = false;
                	boolean namesEqual = true;
                	for (int k = 0 ; k < shorter; k++) {
                		if (names[i].charAt(k) > names[j].charAt(k)) {
                			swap = true;
                			break;
                		}
                		else if (names[i].charAt(k) < names[j].charAt(k)) {
                			namesEqual = false;
                			break;
                		}
                	}
                	
                	if (!swap) {
                		if (namesEqual) {
                			if (names[j].length() == shorter)
                				swap = true;
                		}
                	}
                	
                	if (swap) {
                        temp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = temp;
                        
                        tempName = names[i];
                        names[i] = names[j];
                        names[j] = tempName;
                    }
                }
            }
        }
    }
}