#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
struct point {
  int x, y;
};
int n, ex, ey;
string s;
point pre[N], suf[N];
int check(int len) {
  for (int i = 1; i <= n; i++) {
    int r = i + len - 1;
    if (r > n) break;
    int d = abs(pre[i - 1].x - suf[r + 1].x) + abs(pre[i - 1].y - suf[r + 1].y);
    if (len >= d && !((len - d) & 1)) return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s >> ex >> ey;
  s = "0" + s;
  pre[0] = point{0, 0};
  suf[n + 1] = point{ex, ey};
  for (int i = 1; i <= n; i++) {
    int dx = 0, dy = 0;
    if (s[i] == 'L')
      dx = -1;
    else if (s[i] == 'R')
      dx = 1;
    else if (s[i] == 'U')
      dy = 1;
    else
      dy = -1;
    pre[i] = point{pre[i - 1].x + dx, pre[i - 1].y + dy};
  }
  for (int i = n; i >= 1; i--) {
    int dx = 0, dy = 0;
    if (s[i] == 'L')
      dx = 1;
    else if (s[i] == 'R')
      dx = -1;
    else if (s[i] == 'U')
      dy = -1;
    else
      dy = 1;
    suf[i] = point{suf[i + 1].x + dx, suf[i + 1].y + dy};
  }
  if (pre[n].x == ex && pre[n].y == ey) {
    cout << 0 << endl;
    return 0;
  }
  int l = 1, r = n, res = -1;
  while (l <= r) {
    int mid = l + r >> 1;
    if (check(mid)) {
      res = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << res << endl;
  return 0;
}
