#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, i;
  string s;
  cin >> a >> b >> c;
  cin >> s;
  if (s[b - 1] == s[c - 1]) {
    cout << 0 << endl;
  } else {
    cout << 1 << endl;
  }
}
