#include <bits/stdc++.h>
using namespace std;
const int N = 500101;
int n;
string s;
int nowx[N], nowy[N];
int sx, sy;
int ans = 0x3f3f3f3f;
int check(int sta, int lth) {
  int nx = nowx[sta - 1] + nowx[n] - nowx[lth + sta - 1];
  int ny = nowy[sta - 1] + nowy[n] - nowy[lth + sta - 1];
  int aa = abs(sx - nx) + abs(sy - ny);
  return aa <= lth;
}
int main() {
  cin >> n;
  cin >> s;
  cin >> sx >> sy;
  if (abs(sx + sy) % 2 != n % 2) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    nowx[i] = nowx[i - 1];
    nowy[i] = nowy[i - 1];
    if (s[i - 1] == 'U') {
      nowy[i]++;
    } else if (s[i - 1] == 'D') {
      nowy[i]--;
    } else if (s[i - 1] == 'L') {
      nowx[i]--;
    } else {
      nowx[i]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    int l = 0, r = n - i + 1;
    int nowans = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (check(i, mid)) {
        nowans = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    if (nowans != -1) ans = min(ans, nowans);
  }
  if (ans == 0x3f3f3f3f) {
    cout << "-1" << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}
