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