#include <bits/stdc++.h>
int main() {
  int n, x, y;
  while (~scanf("%d%d%d", &n, &x, &y)) {
    char a[1000005];
    scanf("%s", &a);
    int i;
    int faul = 2;
    if (a[x - 1] == a[y - 1]) {
      faul = 0;
    } else {
      faul = 1;
    }
    if (faul == 0) {
      printf("0\n");
    } else if (faul == 1) {
      printf("1\n");
    }
  }
}
