#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
int n, a, b;
void solve() {
  cin >> n >> a >> b;
  string s;
  cin >> s;
  a--;
  b--;
  if (s[a] == s[b]) {
    cout << 0;
  } else {
    cout << 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
