#include <bits/stdc++.h>
using namespace std;
char fi;
const int INF = 2000000000;
template <class T>
void out(vector<T>& v) {
  for (int i = 0; i < int(v.size()); ++i) cout << v[i] << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(10);
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  int d = 0;
  for (int i = 0; i < int(s.size()); ++i)
    if (s[i] != t[i]) ++d;
  vector<vector<int> > canvi(26, vector<int>(26, -1));
  for (int i = 0; i < int(s.size()); ++i)
    if (s[i] != t[i]) canvi[s[i] - 'a'][t[i] - 'a'] = i;
  for (int i = 0; i < int(canvi.size()); ++i)
    for (int j = 0; j < int(canvi[i].size()); ++j)
      if (canvi[i][j] != -1 and canvi[j][i] != -1) {
        cout << d - 2 << '\n';
        cout << canvi[i][j] + 1 << ' ' << canvi[j][i] + 1 << '\n';
        return 0;
      }
  for (int f = 0; f < 26; ++f)
    for (int p = 0; p < 26; ++p)
      for (int e = 0; e < 26; ++e) {
        if (canvi[p][f] != -1 and canvi[f][e] != -1) {
          cout << d - 1 << '\n';
          cout << canvi[p][f] + 1 << ' ' << canvi[f][e] + 1 << '\n';
          return 0;
        }
      }
  cout << d << '\n';
  cout << -1 << ' ' << -1 << '\n';
}
