#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int inf = 1 << 30;
void solve() {
  int n;
  string s;
  int x, y;
  cin >> n >> s >> x >> y;
  vector<pii> p(n + 1);
  for (int i = 0; i < n; i++) {
    p[i + 1] = p[i];
    if (s[i] == 'U') p[i + 1].second++;
    if (s[i] == 'D') p[i + 1].second--;
    if (s[i] == 'R') p[i + 1].first++;
    if (s[i] == 'L') p[i + 1].first--;
  }
  x -= p[n].first;
  y -= p[n].second;
  auto check = [&](int len) {
    if (!len) return !x && !y;
    for (int i = 0; i <= n - len; i++) {
      int nx = abs(x + p[i + len].first - p[i].first);
      int ny = abs(y + p[i + len].second - p[i].second);
      if (~(nx ^ ny ^ len) & 1 && nx + ny <= len) return true;
    }
    return false;
  };
  if (!check(n)) return void(cout << -1);
  int l = 0, r = n;
  while (l < r) {
    int mi = (l + r) / 2;
    if (check(mi))
      r = mi;
    else
      l = mi + 1;
  }
  cout << l;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int tcs = 1;
  for (int tc = 1; tc <= tcs; tc++) {
    solve();
  }
}
