#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  long long int n;
  cin >> n;
  cin >> s >> t;
  int a[130][130] = {0};
  int i;
  int ans = 0;
  for (i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      ans++;
      a[s[i] - 'A'][t[i] - 'A'] = 1;
    }
  }
  int j;
  for (i = 0; i < 100; i++)
    for (j = 0; j < 100; j++) {
      if (i == j) continue;
      if (a[i][j] == 1 && a[j][i] == 1) goto XX;
    }
  int k;
  for (i = 0; i < 100; i++)
    for (j = 0; j < 100; j++) {
      if (i == j) continue;
      for (k = 0; k < 100; k++) {
        if (i == k || j == k) continue;
        if (a[i][k] == 1 && a[k][j] == 1) goto XY;
      }
    }
  cout << ans << endl;
  cout << "-1 -1" << endl;
  return 0;
XX:;
  ans -= 2;
  int p1, p2;
  for (p1 = 0; p1 < n; p1++) {
    if ((s[p1] - 'A' == i) && (t[p1] - 'A' == j)) break;
  }
  for (p2 = 0; p2 < n; p2++) {
    if ((t[p2] - 'A' == i) && (s[p2] - 'A' == j)) break;
  }
  cout << ans << endl;
  cout << p1 + 1 << " " << p2 + 1 << endl;
  return 0;
XY:;
  ans -= 1;
  for (p1 = 0; p1 < n; p1++) {
    if ((s[p1] - 'A' == i) && (t[p1] - 'A' == k)) break;
  }
  for (p2 = 0; p2 < n; p2++) {
    if ((t[p2] - 'A' == j) && (s[p2] - 'A' == k)) break;
  }
  cout << ans << endl;
  cout << p1 + 1 << " " << p2 + 1 << endl;
  return 0;
}
