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