#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
const int MAXN = 1e6 + 10;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-6;
int main() {
  ios::sync_with_stdio(false);
  int n, a, b;
  string s;
  cin >> n >> a >> b >> s;
  cout << ((s[a - 1] ^ s[b - 1]) ? 1 : 0);
  return 0;
}
