#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
int n, x, y, X[N], Y[N];
string s;
bool check(int l) {
  for (int i = l; i <= n; i++) {
    int xx = X[n] - X[i] + X[i - l];
    int yy = Y[n] - Y[i] + Y[i - l];
    if (abs(xx - x) + abs(y - yy) <= l) return 1;
  }
  return 0;
}
int BS() {
  int l = 0, r = n, mid, ret = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid))
      r = mid - 1, ret = mid;
    else
      l = mid + 1;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s >> x >> y;
  if ((n - abs(x) - abs(y)) < 0 || (n - abs(x) - abs(y)) % 2)
    return cout << -1, 0;
  for (int i = 1; i <= n; i++) {
    X[i] = (X[i - 1] + (s[i - 1] == 'R') - (s[i - 1] == 'L'));
    Y[i] = (Y[i - 1] + (s[i - 1] == 'U') - (s[i - 1] == 'D'));
  }
  cout << BS();
}
