#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
char s[maxn], t[maxn];
int demand[30][30], needs[30], extrat[30];
int n, ans, ansi, ansj;
void Init() {
  memset(demand, 0, sizeof(demand));
  scanf("%d\n", &n);
  scanf("%s", s);
  scanf("%s", t);
}
void Main() {
  ans = 0;
  for (int i = 0; i <= n - 1; ++i) {
    if (s[i] != t[i]) ans++;
    demand[s[i] - 96][t[i] - 96] = i + 1;
  }
  for (int i = 1; i <= 26; ++i) {
    for (int j = 1; j <= 26; ++j) {
      if (i == j) continue;
      if (demand[i][j] && demand[j][i]) {
        printf("%d\n", ans - 2);
        printf("%d %d\n", demand[i][j], demand[j][i]);
        return;
      }
    }
  }
  memset(extrat, 0, sizeof(extrat));
  memset(needs, 0, sizeof(needs));
  for (int i = 0; i <= n - 1; ++i)
    if (s[i] != t[i]) {
      needs[s[i] - 96] = i + 1;
      extrat[t[i] - 96] = i + 1;
    }
  for (int i = 1; i <= 26; ++i) {
    if (needs[i] && extrat[i]) {
      printf("%d\n", ans - 1);
      printf("%d %d\n", needs[i], extrat[i]);
      return;
    }
  }
  printf("%d\n", ans);
  printf("-1 -1\n");
}
int main() {
  Init();
  Main();
  return 0;
}
