#include <bits/stdc++.h>
using namespace std;
void load() {}
const int N = 2e5 + 123;
int n, col[N], row[N], s, t;
char x[N];
bool check(int d) {
  for (int i = d; i <= n; ++i) {
    int x = row[n] - row[i] + row[i - d];
    int y = col[n] - col[i] + col[i - d];
    if (abs(y - s) + abs(t - x) <= d) return 1;
  }
  return 0;
}
void trungtt() {
  scanf("%d", &n);
  scanf("%s", x + 1);
  for (int i = 1; i <= n; ++i) {
    row[i] = row[i - 1];
    col[i] = col[i - 1];
    if (x[i] == 'D') --row[i];
    if (x[i] == 'U') ++row[i];
    if (x[i] == 'L') --col[i];
    if (x[i] == 'R') ++col[i];
  }
  scanf("%d%d", &s, &t);
  if (abs(s) + abs(t) > n || (abs(s) + abs(t) + n) % 2) {
    printf("-1");
    return;
  }
  int d = 0, c = n;
  while (d < c) {
    int mid = (d + c) / 2;
    if (check(mid))
      c = mid;
    else
      d = mid + 1;
  }
  printf("%d", d);
}
int main() {
  load();
  trungtt();
  return 0;
}
