#include <bits/stdc++.h>
int main() {
  char str[100000];
  int n, a, b, c, d;
  scanf("%d%d%d", &n, &a, &b);
  scanf("%s", str);
  c = str[a - 1];
  d = str[b - 1];
  if (c == d)
    printf("0\n");
  else
    printf("1\n");
  return 0;
}
