#include <bits/stdc++.h>
using namespace std;
int n, a, b, res = 2000000000;
char c[111111];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  cout << (c[a] == c[b] ? 0 : 1) << endl;
  return 0;
}
