#include <bits/stdc++.h>
using namespace std;
char ff[100001];
int main() {
  int n, a, b;
  while (~scanf("%d%d%d", &n, &a, &b)) {
    getchar();
    memset(ff, 0, sizeof(ff));
    for (int i = 1; i <= n; i++) {
      scanf("%c", &ff[i]);
    }
    if (ff[a] == ff[b])
      printf("0\n");
    else
      printf("1\n");
  }
}
