#include <bits/stdc++.h>
using namespace std;
int n, x, y, L, R, U, D, lc, rc, uc, dc;
char s[200005];
int my_abs(int x) { return x < 0 ? -x : x; }
bool check(int l, int r, int u, int d) {
  int X = R - L - (r - l), Y = U - D - (u - d);
  return my_abs(x - X) + my_abs(y - Y) <= l + r + u + d;
}
int main() {
  scanf("%d %s %d %d", &n, s + 1, &x, &y);
  if (x < 0) {
    x = -x;
    for (int i = 1; i <= n; i++)
      if (s[i] == 'L')
        s[i] = 'R';
      else if (s[i] == 'R')
        s[i] = 'L';
  }
  if (y < 0) {
    y = -y;
    for (int i = 1; i <= n; i++)
      if (s[i] == 'U')
        s[i] = 'D';
      else if (s[i] == 'D')
        s[i] = 'U';
  }
  if (n < x + y || ((x ^ y) & 1) != (n & 1)) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (s[i] == 'L')
      L++;
    else if (s[i] == 'R')
      R++;
    else if (s[i] == 'U')
      U++;
    else
      D++;
  int l = 1, r = 0, ans = 1e9;
  while (r <= n) {
    if (r - l + 1 >= 0 && check(lc, rc, uc, dc)) {
      ans = min(ans, r - l + 1);
      if (s[l] == 'L')
        lc--;
      else if (s[l] == 'R')
        rc--;
      else if (s[l] == 'U')
        uc--;
      else
        dc--;
      l++;
    } else {
      if (r == n) break;
      ++r;
      if (s[r] == 'L')
        lc++;
      else if (s[r] == 'R')
        rc++;
      else if (s[r] == 'U')
        uc++;
      else
        dc++;
    }
  }
  printf("%d\n", ans == 1e9 ? -1 : ans);
  return 0;
}
