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