#include <bits/stdc++.h>
using namespace std;
char A[100009];
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  for (long long int i = (long long int)1; i <= (long long int)n; i++)
    cin >> A[i];
  if (A[a] == A[b])
    cout << 0;
  else
    cout << 1;
}
