#include <bits/stdc++.h>
using namespace std;
void start() {}
void sober() {
  long long int n, x = 0, a = 0, b = 0, y = 0, sum = 0, k = 0, m = 0;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  a--, b--;
  if (s[a] == s[b])
    cout << "0\n";
  else
    cout << "1\n";
}
signed main() {
  start();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    sober();
  }
}
