#include <bits/stdc++.h>
using namespace std;
template <class T>
int chkmax(T& a, T b) {
  if (b > a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
int chkmin(T& a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class iterator>
void output(iterator begin, iterator end, ostream& out = cerr) {
  while (begin != end) {
    out << (*begin) << " ";
    begin++;
  }
  out << '\n';
}
template <class T>
void output(T x, ostream& out = cerr) {
  output(x.begin(), x.end(), out);
}
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int mx = 2e5 + 228;
int n, cx, cy, px[mx], py[mx], x, y;
string s;
const vector<pair<int, int> > d = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
const string s0 = "UDLR";
pair<int, int> get(char c) {
  for (int i = 0; i < s0.size(); ++i) {
    if (c == s0[i]) {
      return d[i];
    }
  }
  assert(0);
  return {-1, -1};
}
int check(int len) {
  if (len == n + 1) return 1;
  for (int i = 0; i <= n - len; ++i) {
    int sum_x = x - (px[i + len] - px[i]);
    int sum_y = y - (py[i + len] - py[i]);
    if (abs(cx - sum_x) + abs(cy - sum_y) <= len) {
      return 1;
    }
  }
  return 0;
}
signed main() {
  cin >> n;
  cin >> s;
  cin >> cx >> cy;
  if ((abs(cx) + abs(cy)) % 2 != n % 2) {
    cout << -1 << '\n';
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    pair<int, int> pp = get(s[i]);
    px[i + 1] = px[i] + pp.first;
    py[i + 1] = py[i] + pp.second;
  }
  x = px[n];
  y = py[n];
  int l = 0, r = n + 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  int ans = l;
  if (ans == n + 1) ans = -1;
  cout << ans << '\n';
}
