#include <bits/stdc++.h>
using namespace std;
long long int scan() {
  long long int t = 0;
  char c, ch;
  ch = getchar();
  if (ch == '-') {
    c = getchar();
  } else {
    c = ch;
  }
  while (c < '0' || c > '9') {
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    t = (t << 3) + (t << 1) + c - '0';
    c = getchar();
  }
  if (ch == '-') {
    return -t;
  } else {
    return t;
  }
}
map<pair<char, char>, long long> my;
map<char, long long> my1, my2;
int main() {
  ios::sync_with_stdio(false);
  long long int i, j, k, t, n, m, x, y, cnt = 0;
  string s1, s2;
  cin >> n;
  cin >> s1 >> s2;
  for (i = 0; i < n; i++) {
    if (s1[i] != s2[i]) cnt++;
  }
  for (i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      if (my.find(make_pair(s2[i], s1[i])) != my.end()) {
        cout << cnt - 2 << "\n";
        cout << my[make_pair(s2[i], s1[i])] + 1 << " " << i + 1 << "\n";
        return 0;
      }
      my[make_pair(s1[i], s2[i])] = i;
    }
  }
  for (i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      if (my2.find(s1[i]) != my2.end()) {
        cout << cnt - 1 << "\n";
        cout << my2[s1[i]] + 1 << " " << i + 1 << "\n";
        return 0;
      } else if (my1.find(s2[i]) != my1.end()) {
        cout << cnt - 1 << "\n";
        cout << my1[s2[i]] + 1 << " " << i + 1 << "\n";
        return 0;
      }
      my1[s1[i]] = i;
      my2[s2[i]] = i;
    }
  }
  cout << cnt << "\n";
  cout << "-1 -1\n";
  return 0;
}
