#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, d, g[127][127];
int main() {
  cin >> n >> s >> t;
  for (int i = 0; i < n; i++) g[s[i]][t[i]] = i + 1, d += s[i] != t[i];
  for (int i = 'a'; i <= 'z'; i++)
    for (int j = i + 1; j <= 'z'; j++)
      if (g[i][j] && g[j][i]) {
        cout << d - 2 << endl << g[i][j] << " " << g[j][i] << endl;
        return 0;
      }
  for (int i = 'a'; i <= 'z'; i++)
    for (int j = 'a'; j <= 'z'; j++)
      for (int k = 'a'; k <= 'z'; k++)
        if (g[i][j] && g[j][k] && i != j && j != k) {
          cout << d - 1 << endl << g[i][j] << " " << g[j][k] << endl;
          return 0;
        }
  cout << d << endl << "-1 -1" << endl;
  return 0;
}
