#include <bits/stdc++.h>
using namespace std;
struct Letters {
  int num;
  char s;
  char t;
};
vector<Letters> Str1[30];
vector<Letters> Str2[30];
string S, T;
int main() {
  int n;
  while (cin >> n) {
    cin >> S >> T;
    for (int i = 0; i < 26; i++) {
      Str1[i].clear();
      Str2[i].clear();
    }
    Letters l;
    int k1, k2, tot = 0, ok;
    for (int i = 0; S[i]; i++) {
      if (S[i] != T[i]) {
        tot++;
        l.num = i + 1;
        l.s = S[i];
        l.t = T[i];
        k1 = S[i] - 'a';
        k2 = T[i] - 'a';
        ok = 1;
        for (int j = 0; j < Str1[k1].size(); j++) {
          if (Str1[k1][j].t == l.t) {
            ok = 0;
            break;
          }
        }
        if (ok) {
          Str1[k1].push_back(l);
          Str2[k2].push_back(l);
        }
      }
    }
    ok = 0;
    int x = -1, y = -1;
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < Str1[i].size(); j++) {
        for (int k = 0; k < Str2[i].size(); k++) {
          x = Str1[i][j].num;
          y = Str2[i][k].num;
          if (Str1[i][j].t == Str2[i][k].s) ok = 1;
          if (ok) break;
        }
        if (ok) break;
      }
      if (ok) break;
    }
    if (ok)
      tot -= 2;
    else if (x != -1)
      tot -= 1;
    cout << tot << endl;
    cout << x << " " << y << endl;
  }
  return 0;
}
