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