#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
int d[128][128];
int main() {
  string second, T;
  int(n);
  scanf("%d", &n);
  cin >> second >> T;
  int an = 0;
  for (int i = 0; i < (n); ++i) {
    if (second[i] != T[i]) {
      an++;
      d[second[i]][T[i]] = i + 1;
    }
  }
  for (int i = ('a'); i < ('z' + 1); ++i)
    for (int j = (i); j < ('z' + 1); ++j) {
      if (d[i][j] && d[j][i]) {
        printf("%d\n", an - 2);
        printf("%d %d\n", d[i][j], d[j][i]);
        return 0;
      }
    }
  for (int i = ('a'); i < ('z' + 1); ++i) {
    char x = 'a';
    char y = 'a';
    while (x <= 'z' && !d[i][x]) x++;
    while (y <= 'z' && !d[y][i]) y++;
    if (x <= 'z' && y <= 'z') {
      printf("%d\n", an - 1);
      printf("%d %d\n", d[i][x], d[y][i]);
      return 0;
    }
  }
  printf("%d\n-1 -1\n", an);
  return 0;
}
