#include <bits/stdc++.h>
char str1[200005], str2[200005];
int a[40][40];
int main() {
  int n, i, t, flag, x, y, k, j;
  while (scanf("%d", &n) != EOF) {
    memset(a, 0, sizeof(a));
    memset(str1, 0, sizeof(str1));
    memset(str2, 0, sizeof(str1));
    scanf("%s%s", str1 + 1, str2 + 1);
    t = flag = x = y = 0;
    for (i = 1; i <= n; i++) {
      if (str1[i] != str2[i]) {
        a[str1[i] - 'a' + 1][str2[i] - 'a' + 1] = i;
        t++;
      }
    }
    for (i = 1; i <= 26; i++) {
      for (j = 1; j <= 26; j++) {
        if (a[i][j] && a[j][i]) {
          flag = 1;
          x = a[i][j];
          y = a[j][i];
          break;
        }
      }
      if (flag == 1) break;
    }
    if (flag == 1) {
      printf("%d\n", t - 2);
      printf("%d %d\n", x, y);
      continue;
    }
    for (i = 1; i <= 26; i++) {
      for (j = 1; j <= 26; j++) {
        for (k = 1; k <= 26; k++) {
          if (a[i][j] && a[j][k]) {
            flag = 1;
            x = a[i][j];
            y = a[j][k];
            break;
          }
        }
        if (flag == 1) break;
      }
      if (flag == 1) break;
    }
    if (flag == 1) {
      printf("%d\n", t - 1);
      printf("%d %d\n", x, y);
      continue;
    }
    printf("%d\n", t);
    printf("-1 -1\n");
  }
  return 0;
}
