#include <bits/stdc++.h>
using namespace std;
void work();
int main() {
  work();
  return 0;
}
char S[222222];
char T[222222];
int t[256][256];
void work() {
  int n;
  while (scanf("%d", &n) == 1) {
    memset(t, 0, sizeof(t));
    int ans = 0;
    scanf("%s%s", S + 1, T + 1);
    for (int i = (1), END = (n); i <= END; i++)
      if (S[i] != T[i]) {
        ans++;
        t[S[i]][T[i]] = i;
      }
    bool two = false;
    for (int i = ('a'), END = ('z'); i <= END; i++)
      for (int j = (i + 1), END = ('z'); j <= END; j++)
        if (t[i][j] && t[j][i]) {
          two = true;
          printf("%d\n%d %d\n", ans - 2, t[i][j], t[j][i]);
          i = 256;
          j = 256;
        }
    if (two) continue;
    for (int i = ('A'), END = ('Z'); i <= END; i++)
      for (int j = (i + 1), END = ('Z'); j <= END; j++)
        if (t[i][j] && t[j][i]) {
          two = true;
          printf("%d\n%d %d\n", ans - 2, t[i][j], t[j][i]);
          i = 256;
          j = 256;
        }
    if (two) continue;
    bool one = false;
    for (int i = ('a'), END = ('z'); i <= END; i++) {
      int pos = -1;
      for (int j = ('a'), END = ('z'); j <= END; j++)
        if (t[i][j]) pos = t[i][j];
      if (pos == -1) continue;
      for (int j = ('a'), END = ('z'); j <= END; j++)
        if (t[j][i]) {
          one = true;
          printf("%d\n%d %d\n", ans - 1, pos, t[j][i]);
          i = j = 256;
        }
    }
    if (one) continue;
    for (int i = ('A'), END = ('Z'); i <= END; i++) {
      int pos = -1;
      for (int j = ('A'), END = ('Z'); j <= END; j++)
        if (t[i][j]) pos = t[i][j];
      if (pos == -1) continue;
      for (int j = ('A'), END = ('Z'); j <= END; j++)
        if (t[j][i]) {
          one = true;
          printf("%d\n%d %d\n", ans - 1, pos, t[j][i]);
          i = j = 256;
        }
    }
    if (one) continue;
    printf("%d\n%d %d\n", ans, -1, -1);
  }
}
