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