#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, i, a0, a1, b0, b1, ans;
  cin >> n >> a >> b;
  string A;
  cin >> A;
  a--;
  b--;
  if (A[a] == A[b]) {
    cout << 0 << endl;
    return 0;
  } else {
    cout << 1 << endl;
  }
  return 0;
}
