#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 100;
const int MOD = 1e9 + 7;
const int oo = 1e9 + 100;
const long double EPS = 1e-9;
const string DIRS = "UDLR";
int n, x, y;
char str[MAXN];
int acc[256][MAXN];
int get(char ch, int fr, int to) {
  if (to < fr) return 0;
  return acc[ch][to] - acc[ch][fr - 1];
}
int main() {
  while (scanf("%d %s %d %d", &n, str + 1, &x, &y) == 4) {
    for (auto& e : DIRS) {
      acc[e][0] = 0;
      for (int i = 1; i <= n; ++i) {
        acc[e][i] = acc[e][i - 1] + (str[i] == e);
      }
    }
    int init_x = acc['R'][n] - acc['L'][n];
    int init_y = acc['U'][n] - acc['D'][n];
    if (init_x == x && init_y == y) {
      puts("0");
      continue;
    }
    if (abs(x) + abs(y) > n || (n - abs(x) - abs(y)) % 2 != 0) {
      puts("-1");
      continue;
    }
    int lo = 1, hi = n;
    vector<int> aux(256);
    while (lo <= hi) {
      int mi = (lo + hi) >> 1;
      bool ok = false;
      for (int i = 1; i + mi - 1 <= n; ++i) {
        for (auto& e : DIRS) aux[e] = get(e, 1, i - 1) + get(e, i + mi, n);
        int xx = aux['R'] - aux['L'];
        int yy = aux['U'] - aux['D'];
        int rem = mi - (abs(x - xx) + abs(y - yy));
        if (rem >= 0) ok = true;
      }
      if (ok)
        hi = mi - 1;
      else
        lo = mi + 1;
    }
    printf("%d\n", lo);
  }
  return 0;
}
