#include <bits/stdc++.h>
using namespace std;
string S, T;
vector<int> ch[26][26];
int n;
int main() {
  cin >> n;
  cin >> S >> T;
  int ii = -1;
  int jj = -1;
  int red = 0;
  int diff = 0;
  for (int i = 1; i <= n; i++)
    if (S[i - 1] != T[i - 1]) diff++;
  for (int i = 1; i <= n; i++) {
    if (S[i - 1] == T[i - 1]) continue;
    char a = S[i - 1];
    char b = T[i - 1];
    if (ch[b - 'a'][a - 'a'].size() != 0) {
      ii = i;
      jj = ch[b - 'a'][a - 'a'][0];
      red = 2;
      break;
    }
    ch[a - 'a'][b - 'a'].push_back(i);
  }
  if (red == 2) {
    cout << diff - red << endl;
    cout << ii << " " << jj << endl;
    return 0;
  }
  vector<int> ch2[26], ch3[26];
  for (int i = 1; i <= n; i++) {
    if (S[i - 1] == T[i - 1]) continue;
    if (ch2[T[i - 1] - 'a'].size() != 0) {
      red = 1;
      ii = i;
      jj = ch2[T[i - 1] - 'a'][0];
      break;
    }
    if (ch3[S[i - 1] - 'a'].size() != 0) {
      red = 1;
      ii = i;
      jj = ch3[S[i - 1] - 'a'][0];
      break;
    }
    ch2[S[i - 1] - 'a'].push_back(i);
    ch3[T[i - 1] - 'a'].push_back(i);
  }
  cout << diff - red << endl;
  cout << ii << " " << jj << endl;
  return 0;
}
