#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 1e5 + 10;
int main() {
  char str[N];
  int n, a, b;
  while (cin >> n >> a >> b) {
    getchar();
    scanf("%s", str + 1);
    if (str[a] == str[b])
      cout << 0 << endl;
    else
      cout << 1 << endl;
  }
  return 0;
}
