#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  string str;
  char ch;
  cin >> num >> str;
  int i = 0;
  int left = 0, right = 0, up = 0, down = 0;
  while (str[i++] != '\0') {
    switch (str[i - 1]) {
      case 'L':
        left++;
        break;
      case 'R':
        right++;
        break;
      case 'U':
        up++;
        break;
      case 'D':
        down++;
        break;
    }
  }
  int minLR = (left <= right) ? left : right;
  int minUD = (up <= down) ? up : down;
  cout << minLR * 2 + minUD * 2;
  return 0;
}
