#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long INF = 1ll << 60;
const double EPS = 1e-7;
const long long MOD = 998244353;
int n;
char s[N];
int x, y;
int prex[N], prey[N];
bool check(int mid) {
  for (int i = (1); i <= (n - mid + 1); i++) {
    int xx = x - (prex[n] - prex[i + mid - 1] + prex[i - 1]);
    int yy = y - (prey[n] - prey[i + mid - 1] + prey[i - 1]);
    xx = abs(xx);
    yy = abs(yy);
    if (xx + yy <= mid && mid % 2 == (xx + yy) % 2) return true;
  }
  return false;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  scanf("%d%d", &x, &y);
  for (int i = (1); i <= (n); i++) {
    prex[i] = prex[i - 1];
    prey[i] = prey[i - 1];
    if (s[i] == 'U')
      prey[i]++;
    else if (s[i] == 'D')
      prey[i]--;
    else if (s[i] == 'L')
      prex[i]--;
    else if (s[i] == 'R')
      prex[i]++;
  }
  int l = 0, r = n;
  int ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid)) {
      r = mid - 1;
      ans = mid;
    } else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
