#include <bits/stdc++.h>
using namespace std;
map<int, int> nosa;
bool imm[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  memset(imm, 0, sizeof(imm));
  long long n;
  cin >> n;
  string S;
  string T;
  cin >> S >> T;
  vector<pair<int, int>> pnosa;
  long long acans = 0;
  for (long long i = 0; i < n; i++) {
    if (S[i] != T[i]) {
      pnosa.push_back({S[i] - 'a', T[i] - 'a'});
      nosa[S[i] - 'a'] = i;
      imm[i] = true;
      acans++;
    }
  }
  pair<int, int> vals;
  bool flag = false;
  sort(pnosa.begin(), pnosa.end());
  for (long long i = 0; i < pnosa.size(); i++) {
    vals = pnosa[i];
    pair<int, int> tmp = {vals.second, vals.first};
    if (binary_search(pnosa.begin(), pnosa.end(), tmp)) {
      flag = true;
      break;
    }
  }
  if (flag == true) {
    cout << acans - 2 << '\n';
    for (long long i = 0; i < n; i++) {
      if ((S[i] - 'a') == vals.first && (T[i] - 'a') == vals.second) {
        cout << i + 1 << ' ';
        break;
      }
    }
    for (long long i = 0; i < n; i++) {
      if ((S[i] - 'a') == vals.second && (T[i] - 'a') == vals.first) {
        cout << i + 1 << ' ';
        break;
      }
    }
    cout << '\n';
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    if (imm[i]) {
      if (nosa.find(T[i] - 'a') != nosa.end()) {
        cout << acans - 1 << '\n';
        cout << i + 1 << ' ' << nosa[T[i] - 'a'] + 1 << '\n';
        return 0;
      }
    }
  }
  cout << acans << '\n';
  cout << -1 << ' ' << -1 << '\n';
  return 0;
}
