#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
const int INF = 1000000000;
const int MAX = 2007;
const int ADD = 500107;
int main() {
  std::ios::sync_with_stdio(false);
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  if (s[a - 1] == s[b - 1])
    cout << 0;
  else
    cout << 1;
  return 0;
}
