#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
int x[maxn], y[maxn];
char s[maxn];
int n;
int ansx, ansy;
bool judge(int t) {
  for (int i = 1; i <= n - t + 1; i++) {
    int xx = x[i - 1] + x[n] - x[i + t - 1];
    int yy = y[i - 1] + y[n] - y[i + t - 1];
    int num = abs(xx - ansx) + abs(yy - ansy);
    if (num > t) continue;
    if ((t - num) % 2 == 0) return true;
  }
  return false;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  scanf("%d%d", &ansx, &ansy);
  x[0] = y[0] = 0;
  for (int i = 1; i <= n; i++) {
    x[i] = x[i - 1];
    y[i] = y[i - 1];
    if (s[i] == 'U') y[i]++;
    if (s[i] == 'D') y[i]--;
    if (s[i] == 'L') x[i]--;
    if (s[i] == 'R') x[i]++;
  }
  int l = 0, r = n;
  int ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (judge(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
