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