#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int x = 0, y = 0;
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> c;
  for (int i = 0; i < n; i++) {
    c[s[i]]++;
    if (s[i] == 'L') {
      x--;
    }
    if (s[i] == 'R') {
      x++;
    }
    if (s[i] == 'U') {
      y++;
    }
    if (s[i] == 'D') {
      y--;
    }
  }
  int ans = abs(x) + abs(y);
  cout << n - ans << endl;
}
