#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int max(int a, int b, int c) { return max(max(a, b), c); }
int min(int a, int b, int c) { return min(min(a, b), c); }
void input(int a[], int n) {
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
}
void input(vector<int> &a, int n) {
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
}
bool isPalin(string str) {
  int n = str.size();
  for (int i = 0; i < n / 2; i++) {
    if (str[i] != str[n - 1 - i]) return false;
  }
  return true;
}
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  string str;
  cin >> str;
  a--;
  b--;
  if (str[a] == str[b])
    cout << "0\n";
  else
    cout << "1\n";
  return 0;
}
