#include <bits/stdc++.h>
using namespace std;
const int Maxn = 200050;
int n, x, y, xs[Maxn], ys[Maxn];
char s[Maxn];
bool jd(long long len) {
  long long xx, yy, tmp;
  xx = 0, yy = 0;
  xx = xs[n - 1];
  yy = ys[n - 1];
  int L = 0, R = 0;
  R = len;
  if (R >= 0) {
    xx = xx - xs[R - 1];
    yy = yy - ys[R - 1];
  }
  tmp = abs(xx - x) + abs(yy - y);
  if (tmp <= len && (len - tmp) % 2 == 0) {
    return true;
  }
  while (R < n) {
    if (s[R] == 'U') {
      yy--;
    } else if (s[R] == 'D') {
      yy++;
    } else if (s[R] == 'R') {
      xx--;
    } else if (s[R] == 'L') {
      xx++;
    }
    if (s[L] == 'U') {
      yy++;
    } else if (s[L] == 'D') {
      yy--;
    } else if (s[L] == 'R') {
      xx++;
    } else if (s[L] == 'L') {
      xx--;
    }
    L++;
    R++;
    tmp = abs(xx - x) + abs(yy - y);
    if (tmp <= len && (len - tmp) % 2 == 0) {
      return true;
    }
  }
  return false;
}
int main(void) {
  long long L, R, m;
  cin >> n >> s >> x >> y;
  if (s[0] == 'U') {
    ys[0] = 1;
    xs[0] = 0;
  } else if (s[0] == 'D') {
    ys[0] = -1;
    xs[0] = 0;
  } else if (s[0] == 'R') {
    ys[0] = 0;
    xs[0] = 1;
  } else {
    ys[0] = 0;
    xs[0] = -1;
  }
  for (int i = 1; i < n; ++i) {
    if (s[i] == 'U') {
      ys[i] = ys[i - 1] + 1;
      xs[i] = xs[i - 1];
    } else if (s[i] == 'D') {
      ys[i] = ys[i - 1] - 1;
      xs[i] = xs[i - 1];
    } else if (s[i] == 'R') {
      ys[i] = ys[i - 1];
      xs[i] = xs[i - 1] + 1;
    } else {
      ys[i] = ys[i - 1];
      xs[i] = xs[i - 1] - 1;
    }
  }
  L = 0, R = n, m = 0;
  if (!jd(R)) {
    cout << "-1" << endl;
    return 0;
  }
  while (L < R) {
    m = (L + R) / 2;
    if (jd(m)) {
      R = m;
    } else {
      L = m + 1;
    }
  }
  cout << R << endl;
  return 0;
}
