#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
class st {
 public:
  st(int p, char cc) {
    pos = p;
    c = cc;
  }
  int pos;
  char c;
};
int cc[26][26];
int main() {
  int n;
  string s1, s2;
  vector<st> v1, v2;
  vector<int> v3[26];
  cin >> n >> s1 >> s2;
  int dis = 0;
  int p1 = -1, p2 = -1;
  memset(cc[0], -1, 26 * 26 * 4);
  for (int i = 0; i < s1.length(); i++) {
    if (s1[i] != s2[i]) {
      cc[s1[i] - 'a'][s2[i] - 'a'] = i;
      dis++;
    }
  }
  int flag = false;
  int r = 0;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (cc[i][j] >= 0) {
        if (cc[j][i] >= 0) {
          flag = true;
          r = 2;
          p1 = cc[i][j] + 1;
          p2 = cc[j][i] + 1;
          break;
        }
        for (int k = 0; k < 26; k++) {
          if (cc[j][k] >= 0) {
            r = 1;
            p1 = cc[i][j] + 1;
            p2 = cc[j][k] + 1;
            break;
          }
        }
        for (int k = 0; k < 26; k++) {
          if (cc[k][i] >= 0) {
            r = 1;
            p1 = cc[i][j] + 1;
            p2 = cc[k][i] + 1;
            break;
          }
        }
      }
      if (flag) break;
    }
    if (flag) break;
  }
  dis -= r;
  cout << dis << endl << p1 << " " << p2 << endl;
  return 0;
}
