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