#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
int n, x, y;
string step;
int fx[N], fy[N];
int ans = -1;
bool check(int len) {
  for (int l = 1, r = len; r <= n; l++, r++) {
    int nx = fx[n] - (fx[r] - fx[l - 1]);
    int ny = fy[n] - (fy[r] - fy[l - 1]);
    int k = abs(x - nx) + abs(y - ny);
    if (len >= k && (len - k) % 2 == 0) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  cin >> step;
  cin >> x >> y;
  for (int i = 1; i <= n; i++) {
    fx[i] = fx[i - 1], fy[i] = fy[i - 1];
    if (step[i - 1] == 'U')
      fy[i]++;
    else if (step[i - 1] == 'D')
      fy[i]--;
    else if (step[i - 1] == 'L')
      fx[i]--;
    else
      fx[i]++;
  }
  int l = 0, r = n;
  int mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  cout << ans;
  return 0;
}
