#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using str = string;
using unll = unsigned long long;
int max_index(vector<int> vi1) {
  int x = (max_element(((vi1).begin()), ((vi1).end()))) - vi1.begin();
  return x;
}
int min_index(vector<int> vi1) {
  int x = (min_element(((vi1).begin()), ((vi1).end()))) - vi1.begin();
  return x;
}
ll fun(ll n) {
  if (n == 1) return 0;
  return ((n - 1) * n) / 2;
}
int main() {
  int n, a, b;
  string s;
  std::cin >> n >> a >> b >> s;
  if (s[a - 1] == s[b - 1])
    cout << 0;
  else
    cout << 1;
  return 0;
}
