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