#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
template <class T, class U>
istream &operator>>(istream &in, pair<T, U> &p) {
  in >> p.first >> p.second;
  return in;
}
template <class T, class U>
ostream &operator<<(ostream &out, const pair<T, U> &p) {
  out << p.first << ' ' << p.second;
  return out;
}
template <class T>
istream &operator>>(istream &in, vector<T> &v) {
  for (auto &i : v) {
    in >> i;
  }
  return in;
}
template <class T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  for (auto &i : v) {
    out << i << ' ';
  }
  return out;
}
inline void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(time(0));
}
long long bin_pow(long long a, long long b) {
  return b == 0 ? 1 : (b % 2 ? bin_pow(a, b - 1) * a : bin_pow(a * a, b / 2));
}
int n, x, y;
string s;
void F(pair<int, int> &pos, char sobaka, int dist) {
  if (sobaka == 'U') pos.second += dist;
  if (sobaka == 'R') pos.first += dist;
  if (sobaka == 'L') pos.first -= dist;
  if (sobaka == 'D') pos.second -= dist;
}
bool pain(pair<int, int> a, pair<int, int> b, int len) {
  int d = abs(a.first - b.first) + abs(a.second - b.second);
  if (d > len || d % 2 != len % 2) {
    return false;
  }
  return true;
}
bool hate(int len) {
  pair<int, int> pos = make_pair(0, 0);
  for (int i = len; i < n; ++i) {
    F(pos, s[i], 1);
  }
  int l = 0, r = len;
  while (1) {
    if (pain(pos, make_pair(x, y), len)) {
      return true;
    }
    if (r == n) break;
    F(pos, s[l++], 1);
    F(pos, s[r++], -1);
  }
  return false;
}
signed main() {
  io();
  cin >> n >> s >> x >> y;
  int d = abs(x) + abs(y);
  if (d > n || d % 2 != n % 2) {
    cout << -1;
    return 0;
  }
  int l = -1, r = n;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (hate(m))
      r = m;
    else
      l = m;
  }
  cout << r;
  return 0;
}
