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