#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[30][30], sum = 0, b, c, num = 0;
  char s[200005], t[200005];
  memset(a, 0, sizeof(a));
  scanf("%d", &n);
  getchar();
  for (int i = 1; i <= n; i++) {
    scanf("%c", &s[i]);
  }
  getchar();
  for (int i = 1; i <= n; i++) {
    scanf("%c", &t[i]);
    if (t[i] != s[i]) {
      a[s[i] - 'a' + 1][t[i] - 'a' + 1] = i;
      num++;
    }
  }
  for (int i = 1; i <= 26; i++) {
    for (int j = 1; j <= 26; j++) {
      if (a[i][j]) {
        for (int k = 1; k <= 26; k++) {
          if (a[k][i]) {
            if (k == j) {
              sum = 2;
              cout << num - sum << endl;
              cout << a[i][j] << " " << a[j][i] << endl;
            } else {
              if (sum == 0) {
                b = a[i][j];
                c = a[k][i];
              }
              sum = 1;
            }
          }
          if (sum == 2) break;
        }
      }
      if (sum == 2) break;
    }
    if (sum == 2) break;
  }
  if (sum == 1) {
    cout << num - sum << endl;
    cout << b << " " << c << endl;
  }
  if (sum == 0) {
    cout << num - sum << endl;
    cout << -1 << " " << -1 << endl;
  }
  return 0;
}
