#include <bits/stdc++.h>
int main() {
  int n, a, b;
  std::string s;
  std::cin >> n >> a >> b >> s;
  --a, --b;
  int x = std::min(a, b);
  int y = std::max(a, b);
  if (s[x] == s[y]) {
    std::cout << 0 << std::endl;
  } else {
    std::cout << 1 << std::endl;
  }
  return 0;
}
