#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, arr[27] = {0}, count = 0, good = 0, x = -2, y = -2;
  cin >> n;
  char a[n + 1], b[n + 1];
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      count++;
      arr[b[i] - 'a'] = i + 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      if (arr[a[i] - 'a']) {
        good = 1, x = i, y = arr[a[i] - 'a'] - 1;
        if (b[i] == a[arr[a[i] - 'a'] - 1]) {
          good = 2;
          break;
        }
      }
    }
  }
  cout << count - good << "\n" << x + 1 << " " << y + 1;
}
