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