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