#include <bits/stdc++.h>
using namespace std;
char ar[1000009];
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  for (int i = 1; i <= a; i++) {
    cin >> ar[i];
  }
  if (ar[b] != ar[c]) {
    cout << 1 << endl;
  } else
    cout << 0 << endl;
}
