#include <bits/stdc++.h>
using namespace std;
bool prime(int n) {
  if (n < 1) return false;
  for (int x = 2; x * x <= n; x++) {
    if (n % x == 0) return false;
  }
  return true;
}
struct node {
  int value;
  node* right;
  node* left;
};
bool contine8(long long a) {
  while (true) {
    if (a % 10 == 8) return true;
    a /= 10;
    if (a == 0) break;
  }
  return false;
}
int n = 105, m = 105;
vector<int> v[300];
bool visited[300];
void DFS(int a) {
  if (visited[a]) return;
  visited[a] = true;
  for (auto u : v[a]) {
    DFS(u);
  }
}
vector<pair<char, int>> split(string s) {
  char c = s[0];
  int count = 1;
  vector<pair<char, int>> res;
  auto ss = s.c_str();
  for (int i = 1; i <= s.length(); i++) {
    if (ss[i] != c) {
      res.push_back({c, count});
      c = s[i];
      count = 1;
    } else {
      count++;
    }
  }
  return res;
}
const int MAX = 2 * 1e5 + 2;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  a--;
  b--;
  if (s[a] == s[b])
    return cout << 0, 0;
  else
    return cout << 1, 0;
  return 0;
}
