#include <bits/stdc++.h>
using namespace std;
const int N = 200006;
int n, ans;
char a[N], b[N];
vector<int> c[26];
int main() {
  scanf("%d", &n);
  scanf("%s", a);
  scanf("%s", b);
  ans = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] != b[i]) ans++;
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] != b[i]) {
      int p = b[i] - 'a';
      for (int j = 0; j < c[p].size(); ++j) {
        if (c[p][j] == a[i]) {
          for (int j = 0; j < n; ++j) {
            if (a[j] == b[i] && b[j] == a[i]) {
              printf("%d\n%d %d", ans - 2, i + 1, j + 1);
              return 0;
            }
          }
        }
      }
      c[a[i] - 'a'].push_back(b[i]);
    }
  }
  for (char ch = 'a'; ch <= 'z'; ch++) {
    int x = -1, y = -1;
    for (int i = 0; i < n; ++i) {
      if (a[i] == ch && b[i] != ch) x = i;
      if (b[i] == ch && a[i] != ch) y = i;
    }
    if (x != -1 && y != -1) {
      printf("%d\n%d %d", ans - 1, x + 1, y + 1);
      return 0;
    }
  }
  printf("%d\n-1 -1", ans);
  return 0;
}
