#include <bits/stdc++.h>
using namespace std;
const int SIZE = 200000 + 5;
char s[SIZE];
int ex, ey;
int xSum[SIZE];
int ySum[SIZE];
int dx[200], dy[200];
bool judge(int n, int len, int ex, int ey) {
  for (int i = 1; i + len - 1 <= n; ++i) {
    int curx = xSum[i - 1] + xSum[n] - xSum[i + len - 1];
    int cury = ySum[i - 1] + ySum[n] - ySum[i + len - 1];
    int delta = abs(curx - ex) + abs(cury - ey);
    if (delta <= len && (len - delta) % 2 == 0) return true;
  }
  return false;
}
int main() {
  int n;
  dy['U'] = 1;
  dy['D'] = -1;
  dx['L'] = -1;
  dx['R'] = 1;
  scanf("%d\n%s", &n, s + 1);
  scanf("%d%d", &ex, &ey);
  for (int i = 1; i <= n; ++i) {
    xSum[i] = xSum[i - 1] + dx[s[i]];
    ySum[i] = ySum[i - 1] + dy[s[i]];
  }
  int lb = 0, ub = n;
  int ans = -1, mid;
  while (lb <= ub) {
    mid = (lb + ub) / 2;
    if (judge(n, mid, ex, ey)) {
      ans = mid;
      ub = mid - 1;
    } else {
      lb = mid + 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
