#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  long long int i;
  if (s[a - 1] == s[b - 1])
    cout << 0 << endl;
  else {
    for (i = 0; i < n - 1; i++) {
      string s1;
      s1 = s.substr(i, 2);
      if (s1 == "01" || s1 == "10") {
        cout << 1 << endl;
        break;
      }
    }
  }
}
