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