#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  char numA, numB;
  cin >> n >> a >> b;
  for (int i = 0; i < n; ++i) {
    char line;
    cin >> line;
    if (i == a - 1) numA = line;
    if (i == b - 1) numB = line;
  }
  if (numA == numB)
    cout << 0 << endl;
  else
    cout << 1 << endl;
  return 0;
}
