#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, mod = 1e9 + 7;
const long long inf = 1e18;
int n, x, y;
string s;
int main() {
  cin >> n >> s >> x >> y;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L') x++;
    if (s[i] == 'R') x--;
    if (s[i] == 'U') y--;
    if (s[i] == 'D') y++;
  }
  int r = 0, ans = n + 1;
  for (int l = 0; l < n; l++) {
    while (r < n &&
           (((x + y) & 1) != ((r - l) & 1) || (abs(x) + abs(y)) > (r - l))) {
      if (s[r] == 'L') x--;
      if (s[r] == 'R') x++;
      if (s[r] == 'U') y++;
      if (s[r] == 'D') y--;
      r++;
    }
    if (((x + y) & 1) == ((r - l) & 1) && (abs(x) + abs(y)) <= (r - l))
      ans = min(ans, r - l);
    if (s[l] == 'L') x++;
    if (s[l] == 'R') x--;
    if (s[l] == 'U') y--;
    if (s[l] == 'D') y++;
  }
  cout << (ans == (n + 1) ? -1 : ans) << endl;
  return 0;
}
