#include <bits/stdc++.h>
using namespace std;
string S, T;
int n;
void solve() {
  int dist = 0;
  multiset<pair<char, char> > Pairs;
  map<char, int> cnt;
  for (int i = 0; i < n; ++i)
    if (S[i] != T[i]) {
      ++dist;
      Pairs.insert({S[i], T[i]});
      ++cnt[S[i]];
    }
  int one = -1;
  for (int i = 0; i < n; ++i)
    if (S[i] != T[i]) {
      Pairs.erase(Pairs.find({S[i], T[i]}));
      if (Pairs.find({T[i], S[i]}) != Pairs.end()) {
        for (int k = 0; k < n; ++k)
          if (S[k] == T[i] && T[k] == S[i]) {
            cout << dist - 2 << '\n';
            cout << k + 1 << " " << i + 1 << '\n';
            return;
          }
      }
      Pairs.insert({S[i], T[i]});
      if (cnt[T[i]] >= 1) one = i;
    }
  if (one == -1) {
    cout << dist << '\n';
    cout << -1 << " " << -1 << '\n';
  }
  for (int i = 0; i < n; ++i)
    if (i != one && S[i] == T[one] && S[i] != T[i]) {
      cout << dist - 1 << '\n';
      cout << i + 1 << " " << one + 1 << '\n';
      return;
    }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> S >> T;
  solve();
  return 0;
}
