#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, x, y;
int nL, nR, nU, nD;
char s[N];
bool isok(int len, int nl, int nr, int nu, int nd) {
  int cha1 = (nL - nl) - (nR - nr);
  int cha2 = (nD - nd) - (nU - nu);
  int sum = 0;
  if (x <= 0) {
    sum += abs(cha1 + x);
  } else {
    sum += abs(-cha1 - x);
  }
  if (y <= 0) {
    sum += abs(cha2 + y);
  } else {
    sum += abs(-cha2 - y);
  }
  return sum <= len;
}
bool check(int len) {
  int nl = 0, nr = 0, nu = 0, nd = 0;
  for (int i = 1; i <= len; i++)
    if (s[i] == 'L')
      nl++;
    else if (s[i] == 'R')
      nr++;
    else if (s[i] == 'U')
      nu++;
    else
      nd++;
  if (isok(len, nl, nr, nu, nd)) return true;
  for (int i = len + 1; i <= n; i++) {
    if (s[i] == 'L')
      nl++;
    else if (s[i] == 'R')
      nr++;
    else if (s[i] == 'U')
      nu++;
    else
      nd++;
    if (s[i - len] == 'L')
      nl--;
    else if (s[i - len] == 'R')
      nr--;
    else if (s[i - len] == 'U')
      nu--;
    else
      nd--;
    if (isok(len, nl, nr, nu, nd)) return true;
  }
  return false;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  scanf("%d%d", &x, &y);
  if (n < abs(x) + abs(y) || (n - abs(x) - abs(y)) & 1) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (s[i] == 'L')
      nL++;
    else if (s[i] == 'R')
      nR++;
    else if (s[i] == 'U')
      nU++;
    else
      nD++;
  int l = 0, r = n, ans;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
