#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using intpair = pair<int, int>;
using llpair = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b;
  string s;
  cin >> n >> a >> b >> s;
  if (s[a - 1] == s[b - 1]) {
    cout << 0;
  } else
    cout << 1;
  return 0;
}
