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