#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[26][26] = {0};
  int n, i, k, j, h = 0;
  string s, t;
  bool flag = false;
  cin >> n;
  cin >> s;
  cin >> t;
  for (i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      a[s[i] - 97][t[i] - 97] = i + 1;
      h++;
    }
  }
  for (i = 0; i < 26; i++) {
    for (j = i + 1; j < 26; j++) {
      if (a[i][j] != 0 && a[j][i] != 0) {
        flag = true;
        cout << h - 2 << endl;
        cout << a[i][j] << " " << a[j][i];
        break;
      }
    }
    if (flag) break;
  }
  if (!flag) {
    for (i = 0; i < 26; i++) {
      for (j = 0; j < 26; j++) {
        if (a[i][j] != 0) {
          for (k = 0; k < 26; k++) {
            if (a[j][k] != 0) {
              flag = true;
              cout << h - 1 << endl;
              cout << a[i][j] << " " << a[j][k];
              break;
            }
          }
        }
        if (flag) break;
      }
      if (flag) break;
    }
  }
  if (!flag) {
    cout << h << endl;
    cout << "-1 -1";
  }
  return 0;
}
