#include <bits/stdc++.h>
using namespace std;
long long int getint() {
  long long int rn = 0;
  char c = getchar();
  bool flag = 0;
  while (c < '0' || '9' < c) {
    if (c == '-') flag = 1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    rn = rn * 10 + c - '0';
    c = getchar();
  }
  return flag ? -rn : rn;
}
int a, b;
int N;
char str[100000 + 10];
bool vis[100000 + 10];
int main() {
  N = getint(), a = getint(), b = getint();
  scanf("%s", str + 1);
  for (int i = 1; i <= N; ++i) vis[i] = str[i] - '0';
  if (vis[a] == vis[b])
    puts("0");
  else
    puts("1");
}
