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