#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int f[maxn];
int main() {
  int n, m, k;
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    memset(f, 0, sizeof(f));
    for (int i = 1; i <= n; i++) {
      char ch;
      scanf(" %c", &ch);
      f[i] = ch - '0';
    }
    if ((f[m] + f[k]) % 2 == 0)
      printf("0\n");
    else
      printf("1\n");
  }
}
