#include <bits/stdc++.h>
using namespace std;
int xf, yf, n;
int x[200005];
int y[200005];
bool possible(int beg, int len) {
  int dx = x[beg + len] - x[beg];
  int dy = y[beg + len] - y[beg];
  int xr = x[n] - dx, yr = y[n] - dy;
  if (abs(xr - xf) + abs(yr - yf) > len) return false;
  return true;
}
int main() {
  string s;
  cin >> n >> s;
  cin >> xf >> yf;
  if (abs(xf) + abs(yf) > n or (n - abs(xf) + abs(yf)) % 2) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    x[i] = x[i - 1];
    y[i] = y[i - 1];
    if (s[i - 1] == 'R') {
      x[i]++;
    } else if (s[i - 1] == 'L') {
      x[i]--;
    } else if (s[i - 1] == 'U') {
      y[i]++;
    } else {
      y[i]--;
    }
  }
  int ans = 1e9;
  for (int i = 0; i < n; i++) {
    int l = 0, r = n - i;
    int mid = (l + r) / 2;
    while (l < r) {
      if (possible(i, mid))
        r = mid;
      else
        l = mid + 1;
      mid = (l + r) / 2;
    }
    if (possible(i, mid)) {
      ans = min(ans, mid);
    }
  }
  cout << ans;
}
