#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int n;
string s, t;
int cnt[200][200], ans1 = -1, ans2 = -1, ind, dif, cnt2;
char x, y;
inline int find(char a, char b) {
  for (int i = 0; i < n; i++) {
    if (t[i] == a && s[i] == b) return i;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> s >> t;
  for (int i = 0; i < n; i++) {
    cnt[t[i]][s[i]]++;
    if (s[i] != t[i]) cnt2++;
  }
  for (int i = 0; i < n; i++) {
    x = t[i];
    y = s[i];
    if (x == y) continue;
    if (cnt[y][x] > 0) {
      ind = find(y, x);
      ans1 = i + 1;
      ans2 = ind + 1;
      dif = 2;
      cout << cnt2 - 2 << endl;
      cout << i + 1 << " " << ind + 1 << endl;
      goto abc;
    }
  }
  for (int i = 0; i < n; i++) {
    x = t[i];
    y = s[i];
    if (x == y) continue;
    for (int j = 'a'; j <= 'z'; j++) {
      if (j == x || j == y) continue;
      if (cnt[y][j] > 0) {
        ind = find(y, j);
        ans1 = i;
        ans2 = j;
        dif = 1;
        cout << cnt2 - dif << endl;
        cout << i + 1 << " " << ind + 1 << endl;
        goto abc;
      }
    }
  }
  cout << cnt2 << endl;
  cout << -1 << " " << -1 << endl;
abc:;
  return 0;
}
