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