#include <bits/stdc++.h>
int isExist[30];
int isNeed[30];
int isPair[30][30];
char s[200005], t[200005];
int max(int a, int b) { return a > b ? a : b; }
int main() {
  int N;
  scanf("%d%s%s", &N, s, t);
  int dist = 0, m = 0;
  int a = -1, b = -1;
  for (int i = 0; i < N; ++i) {
    if (s[i] != t[i]) {
      ++dist;
      if (m < 2) {
        int p = s[i] - 'a', q = t[i] - 'a';
        isPair[p][q] = isExist[p] = isNeed[q] = i + 1;
        if (isPair[q][p]) {
          m = 2;
          a = isPair[q][p];
          b = i + 1;
        } else if (!m && (isNeed[p] || isExist[q])) {
          m = 1;
          a = max(isNeed[p], isExist[q]);
          b = i + 1;
        }
      }
    }
  }
  printf("%d\n%d %d\n", dist - m, a, b);
  return 0;
}
