#include <bits/stdc++.h>
using namespace std;
map<char, pair<int, int>> D{
    {'U', {0, 1}},
    {'D', {0, -1}},
    {'L', {-1, 0}},
    {'R', {1, 0}},
};
template <typename T>
pair<T, T> operator+(const pair<T, T>& a, const pair<T, T>& b) {
  return {a.first + b.first, a.second + b.second};
}
template <typename T>
pair<T, T> operator-(const pair<T, T>& a) {
  return {-a.first, -a.second};
}
int main() {
  std::ios::sync_with_stdio(false);
  int n, x, y;
  string S;
  cin >> n >> S >> x >> y;
  vector<pair<int, int>> A(n + 1, {0, 0});
  for (int i = 1; i <= n; i++) A[i] = A[i - 1] + D[S[i - 1]];
  if ((A[n].first + A[n].second - x - y) % 2 == 1) {
    cout << -1 << "\n";
    return 0;
  }
  if (A[n].first == x && A[n].second == y) {
    cout << 0 << "\n";
    return 0;
  }
  int best = n + 1;
  for (int i = 0; i < n; i++) {
    int a = i, b = n + 1, c;
    while (a < b) {
      c = (a + b) / 2;
      pair<int, int> p = A[i], q = A[n] + (-A[c]), pq = p + q,
                     dpq = {abs(x - pq.first), abs(y - pq.second)};
      if (dpq.first + dpq.second <= c - i &&
          (c - i) % 2 == (dpq.first + dpq.second) % 2)
        b = c;
      else
        a = c + 1;
    }
    pair<int, int> p = A[i], q = A[n] + (-A[b]), pq = p + q,
                   dpq = {abs(x - pq.first), abs(y - pq.second)};
    if (dpq.first + dpq.second <= b - i &&
        (b - i) % 2 == (dpq.first + dpq.second) % 2) {
      best = min(best, b - i);
    }
  }
  cout << (best == n + 1 ? -1 : best) << "\n";
  return 0;
}
