#include <bits/stdc++.h>
using namespace std;
int n, x = 0, y = 0, Ti;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> s;
  for (char c : s) {
    if (c == 'U')
      y++;
    else if (c == 'D')
      y--;
    else if (c == 'R')
      x++;
    else
      x--;
  }
  Ti = n - abs(x) - abs(y);
  cout << Ti << endl;
  return 0;
}
