#include <bits/stdc++.h>
using namespace std;
int n, a, b;
char ch[100000 + 10];
int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) cin >> ch[i];
  int x = 0, y = 0, dis = 0;
  for (int i = 1; i <= n; i++) {
    if (ch[i] == '1')
      x = i;
    else
      y = i;
    if (x && y) {
      if (dis == 0)
        dis = abs(x - y);
      else if (dis > abs(x - y))
        dis = abs(x - y);
    }
  }
  if (ch[a] == ch[b]) dis = 0;
  cout << dis;
}
