#include <bits/stdc++.h>
using namespace std;
int n, x, y;
char a[100005];
int main(void) {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  if (a[x] == a[y])
    puts("0");
  else
    puts("1");
}
