#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
char s[maxn];
int L1[maxn], L2[maxn];
int R1[maxn], R2[maxn];
int x, y;
int n;
bool check(int cnt) {
  for (int i = 1; i <= n - cnt + 1; i++) {
    int l = i - 1, r = i + cnt;
    int xx = L1[l] + R1[r];
    int yy = L2[l] + R2[r];
    int t1 = abs(xx - x), t2 = abs(yy - y);
    if (t1 + t2 <= cnt && (cnt - t1 - t2) % 2 == 0) {
      return true;
    }
  }
  return false;
}
int main() {
  cin >> n;
  cin >> s + 1;
  cin >> x >> y;
  if (abs(x) + abs(y) > n || (n - abs(x) - abs(y)) % 2) {
    cout << -1 << endl;
    return 0;
  }
  L1[0] = L2[0] = 0;
  for (int i = 1; i <= n; i++) {
    L1[i] = L1[i - 1];
    L2[i] = L2[i - 1];
    if (s[i] == 'L') {
      L1[i]--;
    } else if (s[i] == 'R') {
      L1[i]++;
    } else if (s[i] == 'D') {
      L2[i]--;
    } else if (s[i] == 'U') {
      L2[i]++;
    }
  }
  R1[n + 1] = R2[n + 1] = 0;
  for (int i = n; i >= 1; i--) {
    R1[i] = R1[i + 1];
    R2[i] = R2[i + 1];
    if (s[i] == 'L') {
      R1[i]--;
    } else if (s[i] == 'R') {
      R1[i]++;
    } else if (s[i] == 'D') {
      R2[i]--;
    } else if (s[i] == 'U') {
      R2[i]++;
    }
  }
  if (L1[n] == x && L2[n] == y) {
    cout << 0 << endl;
    return 0;
  }
  int l = 1, r = n;
  int ans = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
