#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  char d[n + 1];
  cin >> d;
  if (d[a - 1] != d[b - 1])
    cout << 1;
  else
    cout << 0;
  return 0;
}
