#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e6 + 5;
long long int POWER[65];
long long int aonb(long long int a, long long int b) {
  long long int ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    if (ret >= MOD) ret %= MOD;
    if (a >= MOD) a %= MOD;
    b >>= 1;
  }
  return ret;
}
void precompute() {
  POWER[0] = 1;
  for (int i = 1; i < 63; i++) POWER[i] = POWER[i - 1] << 1LL;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int a, b;
  cin >> a >> b;
  string str;
  cin >> str;
  if (str[a - 1] == str[b - 1]) {
    cout << 0;
    return 0;
  } else {
    cout << 1;
    return 0;
  }
  return 0;
}
