#include <bits/stdc++.h>
int main() {
  int n, a, b, k1 = 0, k2 = 0;
  int i, j, cost = 0;
  char x[100000];
  scanf("%d%d%d", &n, &a, &b);
  scanf("%s", x);
  if (x[a - 1] == x[b - 1])
    cost = 0;
  else
    cost = 1;
  printf("%d", cost);
}
