#include <bits/stdc++.h>
using namespace std;
int n, d;
string s, t;
map<pair<char, char>, vector<int> > M;
map<char, vector<int> > N;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> s >> t;
  d = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] != t[i]) {
      M[make_pair(s[i], t[i])].push_back(i + 1);
      N[s[i]].push_back(i + 1);
      ++d;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] != t[i]) {
      map<pair<char, char>, vector<int> >::iterator it =
          M.find(make_pair(t[i], s[i]));
      if (it != M.end()) {
        cout << d - 2 << endl;
        cout << i + 1 << " " << it->second.back() << endl;
        return 0;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] != t[i]) {
      if (N.find(t[i]) != N.end()) {
        cout << d - 1 << endl;
        cout << i + 1 << " " << N[t[i]].back() << endl;
        return 0;
      }
    }
  }
  cout << d << endl;
  cout << "-1 -1" << endl;
  return 0;
}
