#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
char op[maxn];
int main() {
  int n, a, b;
  while (~scanf("%d%d%d", &n, &a, &b)) {
    scanf("%s", op + 1);
    if (op[a] == op[b] || n == 1 || a == b) {
      cout << 0 << endl;
      continue;
    } else
      cout << 1 << endl;
  }
  return 0;
}
