#include <bits/stdc++.h>
using namespace std;
bool vowel(char a) {
  a = toupper(a);
  if ((a == 'A') || (a == 'E') || (a == 'I') || (a == 'O') || (a == 'U'))
    return 1;
  return 0;
}
long long int n, m, q, a, b, c, sum = 0, cnt = 0;
long long int arr[123456];
map<long long int, bool> mp;
string str;
int main() {
  cin >> n;
  cin >> a >> b >> str;
  if (str[a - 1] == str[b - 1])
    cout << 0 << endl;
  else
    cout << 1 << endl;
}
