#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 100010;
int n;
string s, t;
int cnt[32][32], ls[32][32];
int dis;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  cin >> s >> t;
  for (int i = 0, _n = (n); i < _n; ++i) {
    int a = s[i] - 'a';
    int b = t[i] - 'a';
    if (a != b) {
      cnt[a][b]++;
      dis++;
      ls[a][b] = i;
    }
  }
  for (int i = 0, _n = (n); i < _n; ++i) {
    int a = s[i] - 'a';
    int b = t[i] - 'a';
    if (a != b and cnt[b][a] != 0) {
      cout << dis - 2 << endl;
      cout << ls[a][b] + 1 << " " << ls[b][a] + 1 << endl;
      return 0;
    }
  }
  for (int i = 0, _n = (n); i < _n; ++i) {
    int a = s[i] - 'a';
    int b = t[i] - 'a';
    if (a != b) {
      for (int j = 0, _n = (26); j < _n; ++j) {
        if (cnt[b][j] != 0) {
          cout << dis - 1 << endl;
          cout << i + 1 << " " << ls[b][j] + 1 << endl;
          return 0;
        }
      }
    }
  }
  cout << dis << endl << "-1 -1" << endl;
  return 0;
}
