#include <bits/stdc++.h>
int main() {
  int n;
  int a;
  int b;
  int k = 0;
  int t = 0;
  int i;
  int j;
  scanf("%d", &n);
  scanf("%d", &a);
  scanf("%d\n", &b);
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  char str[n];
  for (i = 0; i < n; i++) {
    scanf("%c", &str[i]);
  }
  int p = a - 1;
  int q = b - 1;
  if (str[p] == str[q])
    printf("%c", '0');
  else
    printf("%c", '1');
  return 0;
}
