#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0, h[200020], r = -1, l = -1;
  char s[200020], t[200020];
  bool y;
  scanf("%d %s %s", &n, s + 1, t + 1);
  for (int i = 1; i <= n; i++)
    if (s[i] != t[i]) ans++, h[t[i]] = i;
  for (int i = 1; i <= n; i++) {
    if (s[i] != t[i]) {
      if (h[s[i]]) y = 1, l = i, r = h[s[i]];
      if (t[i] == s[h[s[i]]]) {
        ans--;
        break;
      }
    }
  }
  if (r == -1 && l == -1) ans++;
  if (y)
    printf("%d\n%d %d\n", ans - 1, l, r);
  else
    printf("%d\n-1 -1\n", ans);
}
