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