#include <bits/stdc++.h>
using namespace std;
int Inp() {
  char c = getchar();
  int Neg = 1;
  while (c < '0' || c > '9') {
    if (c == '-') Neg = -1;
    c = getchar();
  }
  int Sum = 0;
  while (c >= '0' && c <= '9') {
    Sum = ((Sum << 3) + (Sum << 1)) + c - '0';
    c = getchar();
  }
  return Neg * Sum;
}
char s[200010];
int Get(char c) {
  if (c == 'U') return 0;
  if (c == 'D') return 1;
  if (c == 'L') return 2;
  return 3;
}
int Sum[200010][10];
int n, x, y;
bool Check(int Len) {
  for (int i = 1; i <= n - Len + 1; i++) {
    int l = i;
    int r = i + Len - 1;
    int xx = (Sum[n][3] - Sum[r][3] + Sum[l - 1][3]) -
             (Sum[n][2] - Sum[r][2] + Sum[l - 1][2]);
    int yy = (Sum[n][0] - Sum[r][0] + Sum[l - 1][0]) -
             (Sum[n][1] - Sum[r][1] + Sum[l - 1][1]);
    if (abs(x - xx) + abs(y - yy) <= Len) return true;
  }
  return false;
}
int main() {
  n = Inp();
  scanf("%s", s + 1);
  x = Inp();
  y = Inp();
  int Need = abs(x) + abs(y);
  if (Need > n || Need % 2 != n % 2) {
    printf("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 3; j++)
      Sum[i][j] = Sum[i - 1][j] + (Get(s[i]) == j ? 1 : 0);
  int l = 0;
  int r = n;
  while (l < r) {
    int Mid = (l + r) >> 1;
    if (Check(Mid))
      r = Mid;
    else
      l = Mid + 1;
  }
  printf("%d", l);
}
