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