#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int x[maxn], y[maxn];
int X, Y, n;
bool judge(int mid) {
  for (int i = 1; i <= n + 1 - mid; ++i) {
    int j = i + mid - 1;
    int dx = x[j] - x[i - 1], dy = y[j] - y[i - 1];
    int dis = abs(x[n] - dx - X) + abs(y[n] - dy - Y);
    if (dis <= mid && abs(dis - mid) % 2 == 0) return true;
  }
  return false;
}
int main() {
  cin >> n;
  string s;
  cin >> s;
  cin >> X >> Y;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'U') y[i + 1] = 1;
    if (s[i] == 'D') y[i + 1] = -1;
    if (s[i] == 'R') x[i + 1] = 1;
    if (s[i] == 'L') x[i + 1] = -1;
    x[i + 1] += x[i], y[i + 1] += y[i];
  }
  int l = 0, r = n;
  int ans = 0x3f3f3f3f;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (judge(mid))
      ans = min(ans, mid), r = mid - 1;
    else
      l = mid + 1;
  }
  if (ans == 0x3f3f3f3f)
    cout << -1 << endl;
  else
    cout << ans << endl;
  return 0;
}
