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