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