#include <bits/stdc++.h>
using namespace std;
const double eps = 0.0000001;
const int inf = 1e9 + 7;
const int maxn = 1000005;
char str[100005];
int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  scanf("%s", str);
  if (a > b) swap(a, b);
  if (str[a - 1] == str[b - 1])
    printf("0\n");
  else {
    printf("1\n");
  }
}
