#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  s = "M" + s;
  if (s[a] == s[b])
    cout << 0 << endl;
  else {
    int prev = -100000000, nex = 100000000;
    for (int i = b; i <= n; i++) {
      if (s[i] == s[a]) {
        nex = i;
        break;
      }
    }
    for (int i = b; i >= 0; i--) {
      if (s[i] == s[a]) {
        prev = i;
        break;
      }
    }
    cout << 1 << endl;
  }
}
