#include <bits/stdc++.h>
int arr[100000 + 2], n, a, b;
int solve(void) {
  if (arr[a] == arr[b]) return 0;
  return 1;
}
int main(void) {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; i++) scanf("%1d", &arr[i]);
  printf("%d", solve());
}
