#include <bits/stdc++.h>
using namespace std;
int n, a, b;
string ss;
int solve() {
  int mx = 1e9;
  if (ss[a] == ss[b]) return 0;
  int l = -1, r = 0;
  while (r < n && ss[r] != '1') {
    r++;
  }
  for (int i = 0; i < n; i++) {
    if (ss[i] == '1') l = i;
    if (r <= l) {
      r++;
      while (r < n && ss[r] != '1') {
        r++;
      }
    }
    if (ss[i] == '0') {
      if (l != -1) mx = min(mx, i - l);
      if (r < n) mx = min(mx, r - i);
    }
  }
  return mx;
}
int main() {
  cin >> n >> a >> b >> ss;
  a--;
  b--;
  cout << solve() << endl;
}
