#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  bool is = true;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      is = false;
      break;
    }
  }
  return is;
}
int GCD(int a, int b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, a, b;
  cin >> n >> a >> b;
  a -= 1;
  b -= 1;
  string s;
  cin >> s;
  if (s[a] == s[b])
    cout << 0;
  else
    cout << 1;
  return 0;
}
