#include <bits/stdc++.h>
using MapInt = std::map<int, int>;
using VectorInt = std::vector<int>;
using VectorInt2D = std::vector<VectorInt>;
using VectorChar = std::vector<char>;
using VectorChar2D = std::vector<VectorChar>;
using VectorString = std::vector<std::string>;
int main() {
  int n;
  std::cin >> n;
  std::string s;
  s.reserve(n);
  std::string t;
  t.reserve(n);
  std::cin >> s >> t;
  using CharPosPair = std::pair<char, int>;
  using VectorCharPos = std::vector<CharPosPair>;
  using VectorCharPos2D = std::vector<VectorCharPos>;
  VectorInt2D posS(26, VectorInt(26, -1));
  VectorInt2D posT(26, VectorInt(26, -1));
  int k = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] != t[i]) {
      ++k;
      posS[s[i] - 'a'][t[i] - 'a'] = i;
      posT[t[i] - 'a'][s[i] - 'a'] = i;
    }
  }
  using PairInt = std::pair<int, int>;
  PairInt replOne(-1, -1);
  for (int i = 0; i < 26; ++i) {
    for (int j = 0; j < 26; ++j) {
      if (posS[i][j] != -1) {
        if (posT[i][j] != -1) {
          std::cout << (k - 2) << "\n"
                    << (posS[i][j] + 1) << " " << (posT[i][j] + 1);
          return 0;
        }
        for (int m = 0; replOne.first == -1 && m < 26; ++m) {
          if (posT[i][m] != -1) {
            replOne = PairInt(posS[i][j] + 1, posT[i][m] + 1);
          }
        }
      }
    }
  }
  if (replOne.first == -1) {
    std::cout << k << "\n-1 -1";
  } else {
    std::cout << (k - 1) << "\n" << replOne.first << " " << replOne.second;
  }
  return 0;
}
