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