#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long a, b, c;
  cin >> a >> b >> c;
  string s;
  cin >> s;
  if (s[(b - 1)] == s[(c - 1)])
    cout << 0;
  else
    cout << 1;
  return 0;
}
