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