#include <bits/stdc++.h>
using namespace std;
const int INF = 2123123123;
int N, A, B;
char str[100005];
int main() {
  scanf("%d %d %d", &N, &A, &B);
  scanf("%s", str);
  printf("%d", (str[A - 1] != str[B - 1]) ? 1 : 0);
  return 0;
}
