#include <bits/stdc++.h>
using namespace std;
void solution() {
  int v[26][26], res = 0;
  memset(v, -1, sizeof(v));
  ;
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  for (int i = 0; i < int(n); i++) {
    if (a[i] != b[i]) {
      res++;
      if (v[a[i] - 'a'][b[i] - 'a'] == -1) v[a[i] - 'a'][b[i] - 'a'] = i + 1;
    }
  }
  int x = -1, y = -1;
  for (int i = 0; i < int(26); i++) {
    for (int j = 0; j < int(26); j++) {
      if (v[i][j] != -1) {
        if (v[j][i] != -1) {
          cout << (res - 2) << endl << v[i][j] << " " << v[j][i];
          return;
        }
        if (x == -1)
          for (int k = 0; k < int(26); k++) {
            if (v[j][k] != -1) {
              x = v[i][j], y = v[j][k];
              break;
            }
          }
      }
    }
  }
  if (x == -1) {
    cout << res << endl << "-1 -1";
    return;
  }
  cout << (res - 1) << endl << x << " " << y;
}
int main() {
  solution();
  return 0;
}
