#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int maxn = 200010;
char str1[maxn], str2[maxn];
int pos[30], num[maxn];
int vis[30][30];
int main() {
  int n;
  while (scanf("%d", &n) != -1) {
    scanf("%s%s", str1, str2);
    memset(vis, -1, sizeof(vis));
    memset(pos, inf, sizeof(pos));
    int cnt = 0, pos1 = -1, pos2 = -1;
    for (int i = 0; i < n; i++) {
      if (str1[i] != str2[i]) {
        num[cnt++] = i;
        int a = str1[i] - 'a' + 1;
        int b = str2[i] - 'a' + 1;
        pos[a] = min(pos[a], i);
        vis[a][b] = i;
        if (vis[b][a] != -1) {
          pos1 = vis[a][b];
          pos2 = vis[b][a];
        }
      }
    }
    if (cnt == 0 || cnt == 1) {
      printf("%d\n", cnt);
      printf("-1 -1\n");
    } else {
      if (pos1 != -1) {
        printf("%d\n", cnt - 2);
        printf("%d %d\n", pos1 + 1, pos2 + 1);
      } else {
        int flag = 0;
        for (int i = 0; i < cnt; i++) {
          int a = str2[num[i]] - 'a' + 1;
          if (pos[a] != inf) {
            flag = 1;
            pos1 = num[i], pos2 = pos[a];
            break;
          }
        }
        if (flag == 0) {
          printf("%d\n", cnt);
          printf("-1 -1\n");
        } else {
          printf("%d\n", cnt - 1);
          printf("%d %d\n", pos1 + 1, pos2 + 1);
        }
      }
    }
  }
  return 0;
}
