#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int N, ans = 0;
int V[26][26];
int main() {
  scanf("%d", &N);
  cin >> s1;
  cin >> s2;
  memset(V, -1, sizeof V);
  for (int i = 0; i < N; i++) {
    if (s1[i] != s2[i]) {
      ans++;
      V[s1[i] - 'a'][s2[i] - 'a'] = i;
    }
  }
  int l, r;
  l = r = -2;
  int cnt = 0;
  bool ok = 0;
  if (ans) {
    for (int i = 0; i < N && !ok; i++) {
      if (s1[i] != s2[i]) {
        for (int j = 0; j < 26 && !ok; j++) {
          if (V[s2[i] - 'a'][j] != -1) {
            if (j == s1[i] - 'a') {
              cnt = 2;
              l = i;
              r = V[s2[i] - 'a'][j];
              ok = 1;
              break;
            } else {
              cnt = 1;
              l = i;
              r = V[s2[i] - 'a'][j];
            }
          }
        }
      }
    }
  }
  cout << ans - cnt << endl;
  ++l;
  ++r;
  cout << l << " " << r << endl;
  return 0;
}
