#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, n, t, i, minn, count = 0, temp, pos;
  string s;
  cin >> n >> a >> b;
  cin >> s;
  if (s[a - 1] == s[b - 1]) {
    cout << "0" << endl;
  } else {
    cout << "1" << endl;
  }
  return 0;
}
