#include <bits/stdc++.h>
using namespace std;
char s[200005];
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  cin >> s + 1;
  int pos;
  int len = strlen(s + 1);
  if (s[a] == '0' && s[b] == '0') {
    cout << 0 << endl;
  } else if (s[a] == '1' && s[b] == '1') {
    cout << 0 << endl;
  } else
    cout << 1 << endl;
  return 0;
}
