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