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