#include <bits/stdc++.h>
using namespace std;
const int size = 1e5 + 7;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, b;
  string s;
  cin >> n >> a >> b;
  cin >> s;
  if (s[a - 1] == s[b - 1]) {
    cout << 0;
  } else
    cout << 1;
  return 0;
}
