#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, c = getchar(), f = 0;
  for (; c > '9' || c < '0'; f = c == '-', c = getchar())
    ;
  for (; c >= '0' && c <= '9'; c = getchar()) x = (x << 1) + (x << 3) + c - '0';
  return f ? -x : x;
}
const long long mod = 1e9 + 7;
const int maxn = 2e5 + 10;
int n, x, y;
char s[maxn];
int a[maxn], b[maxn];
bool isok(int len) {
  for (int i = 1; i <= n - len + 1; i++) {
    int j = i + len - 1;
    int ta = a[i - 1] + a[n] - a[j], tb = b[i - 1] + b[n] - b[j];
    int dis = abs(ta - x) + abs(tb - y);
    if (dis > len || (dis - len) % 2 == 1)
      continue;
    else
      return true;
  }
  return false;
}
int main() {
  n = read();
  scanf("%s", s + 1);
  x = read(), y = read();
  int m = abs(x) + abs(y);
  if (m > n || (n - m) % 2 == 1) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'L')
      a[i] = a[i - 1] - 1, b[i] = b[i - 1];
    else if (s[i] == 'R')
      a[i] = a[i - 1] + 1, b[i] = b[i - 1];
    else if (s[i] == 'D')
      b[i] = b[i - 1] - 1, a[i] = a[i - 1];
    else if (s[i] == 'U')
      b[i] = b[i - 1] + 1, a[i] = a[i - 1];
  }
  int l = 0, r = n;
  while (l < r) {
    int mid = (l + r) / 2;
    if (isok(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", l);
  return 0;
}
