#include <bits/stdc++.h>
using namespace std;
using Int = int;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  Int n, a, b;
  cin >> n >> a >> b;
  --a, --b;
  string s;
  cin >> s;
  cout << (s[a] == s[b] ? 0 : 1) << endl;
}
