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