#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 1000000000009;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string s;
  int n{}, a{}, b{};
  cin >> n >> a >> b >> s;
  (s[--a] == s[--b]) ? cout << '0' << "\n"
                     : cout << "1"
                            << "\n";
  return 0;
}
