#include <bits/stdc++.h>
using namespace std;
char s[200003], t[200003];
int mat[26][26];
int up[26], down[26];
int main() {
  int n;
  scanf("%d", &n);
  gets(s);
  gets(s);
  gets(t);
  int dist = 0;
  for (int i = 0; i < n; i++) {
    mat[s[i] - 97][t[i] - 97]++;
    up[s[i] - 97]++;
    down[t[i] - 97]++;
    dist += (s[i] != t[i]);
  }
  int x = -1;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    mat[s[i] - 97][t[i] - 97]--;
    up[s[i] - 97]--;
    down[t[i] - 97]--;
    if (s[i] != t[i]) {
      if (mat[t[i] - 97][s[i] - 97] && ans < 2) {
        ans = 2;
        x = i + 1;
      } else if (up[t[i] - 97] - mat[t[i] - 97][t[i] - 97] && ans < 1) {
        ans = 1;
        x = i + 1;
      } else if (down[s[i] - 97] - mat[s[i] - 97][s[i] - 97] && ans < 1) {
        ans = 1;
        x = i + 1;
      }
    }
  }
  if (ans == 0)
    printf("%d\n-1 -1\n", dist);
  else if (ans == 2) {
    printf("%d\n", dist - ans);
    for (int i = x; i < n; i++)
      if (s[x - 1] == t[i] && t[x - 1] == s[i]) {
        printf("%d %d\n", x, i + 1);
        break;
      }
  } else if (ans == 1) {
    printf("%d\n", dist - ans);
    for (int i = x; i < n; i++) {
      if ((s[x - 1] == t[i] || t[x - 1] == s[i]) && (s[i] != t[i])) {
        printf("%d %d\n", x, i + 1);
        break;
      }
    }
  }
  return 0;
}
