#include <bits/stdc++.h>
char s[100001];
int main(void) {
  int a, b, num;
  scanf("%d %d %d", &num, &a, &b);
  scanf("%s", s);
  if (s[a - 1] == s[b - 1])
    printf("0\n");
  else
    printf("1\n");
  return 0;
}
