#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
string s;
int ans;
int32_t main() {
  ios_base::sync_with_stdio(false);
  ;
  int n, a, b;
  cin >> n >> a >> b;
  a--, b--;
  cin >> s;
  if (s[a] != s[b]) ans = 1;
  cout << ans << endl;
  return 0;
}
