#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n, m, a;
  cin >> n >> m >> a;
  string s;
  cin >> s;
  if (s[--m] == s[--a]) {
    cout << 0;
  } else
    cout << 1;
}
