#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;
int n, a, b;
int d[MAXN];
char c;
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; ++i) {
    cin >> c;
    if (c == '1') d[i] = 1;
  }
  if (d[a] == d[b])
    cout << 0;
  else
    cout << 1;
  return 0;
}
