#include <bits/stdc++.h>
using namespace std;
const int pi = 3.14159265;
const int INF = 1 << 30;
const int maxn = 1e5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b;
  string s;
  cin >> n >> a >> b;
  cin >> s;
  cout << ((s[a - 1] == s[b - 1]) ? 0 : 1) << endl;
}
