#include <bits/stdc++.h>
inline void scanint(int &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
int cmp_double(double a, double b, double eps = 1e-9) {
  return a + eps > b ? b + eps > a ? 0 : 1 : -1;
}
using namespace std;
const int INF = 0x3F3F3F3F;
const int NEGINF = 0xC0C0C0C0;
int main() {
  string A, B;
  int t;
  cin >> t;
  cin >> A >> B;
  int ans = 0;
  vector<map<char, int> > mapa;
  mapa.assign(27, map<char, int>());
  for (int i = 0; i < t; i++) {
    char c1, c2;
    c1 = A[i] - 'a';
    c2 = B[i] - 'a';
    if (c1 == c2) continue;
    ans++;
    mapa[c1][c2] = i;
  }
  map<char, int>::iterator it;
  int p1, p2;
  p1 = -2;
  p2 = -2;
  int ans2 = 0;
  for (int i = 0; i <= 26; i++) {
    if (mapa[i].size() == 0) continue;
    for (int j = 0; j <= 26; j++) {
      if (i == j) continue;
      if (mapa[i].find(j) != mapa[i].end()) {
        if (mapa[j].size() == 0) continue;
        ans2 = 1;
        p1 = mapa[i][j];
        if (mapa[j].find(i) != mapa[j].end()) {
          p2 = mapa[j][i];
          ans2 = 2;
          break;
        }
        if (mapa[j].size()) p2 = (*mapa[j].begin()).second;
      }
    }
    if (ans2 == 2) break;
  }
  cout << ans - ans2 << endl;
  cout << min(p1 + 1, p2 + 1) << " " << max(p1 + 1, p2 + 1) << endl;
  return 0;
}
