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