#include <bits/stdc++.h>
const double eps = 1e-8;
const int MAXN = (int)1e9 + 5;
using namespace std;
std::map<char, std::set<char> > m;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  int res = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      m[s[i]].insert(t[i]);
      cnt++;
    }
  }
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == t[i]) continue;
    if (m.find(t[i]) != m.end()) {
      flag = true;
      break;
    }
  }
  if (!flag) {
    cout << cnt << endl;
    puts("-1 -1");
    return 0;
  }
  flag = false;
  char ta, tb, tt;
  for (int i = 0; i < n; i++) {
    if (s[i] == t[i]) continue;
    if (m.find(t[i]) != m.end()) {
      ta = t[i];
      if (m[t[i]].count(s[i])) {
        flag = true;
        tb = t[i];
        tt = s[i];
        break;
      }
    }
  }
  if (!flag) {
    cout << cnt - 1 << endl;
    int x, y;
    for (int i = 0; i < n; i++) {
      if (s[i] == t[i]) continue;
      if (t[i] == ta) x = i;
      if (s[i] == ta) y = i;
    }
    cout << x + 1 << ' ' << y + 1 << endl;
  } else {
    cout << cnt - 2 << endl;
    int x = -1, y = -1;
    for (int i = 0; i < n; i++) {
      if (s[i] == t[i]) continue;
      if (x == -1 && s[i] == tt && t[i] == tb) x = i;
      if (y == -1 && s[i] == tb && t[i] == tt) y = i;
    }
    cout << x + 1 << ' ' << y + 1 << endl;
  }
  return 0;
}
