#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, hammingDis = 0, x, y, c;
  string s, t;
  map<pair<char, char>, int> mp;
  pair<char, char> p;
  cin >> n >> s >> t;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      mp[make_pair(s[i], t[i])] = i;
      hammingDis++;
    }
  }
  c = 0;
  x = y = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      p = make_pair(t[i], s[i]);
      if (mp.find(p) != mp.end()) {
        c = 2;
        x = i + 1;
        y = mp[p] + 1;
        break;
      }
      for (char j = 'a'; j <= 'z'; j++) {
        p = make_pair(j, s[i]);
        if (mp.find(p) != mp.end()) {
          x = i + 1;
          y = mp[p] + 1;
          c = 1;
        }
      }
    }
  }
  if (x > y) swap(x, y);
  cout << (hammingDis - c) << "\n" << x << " " << y << endl;
  return 0;
}
