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