#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  string x;
  cin >> x;
  if (x[A - 1] == x[B - 1])
    cout << 0 << "\n";
  else {
    cout << 1 << "\n";
  }
}
