#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long INF64 = 1e18;
const long double EPS = 1e-7;
mt19937 myrand(time(NULL));
const int N = 30;
int a[N][N];
int n;
string s, t;
bool read() {
  if (scanf("%d\n", &n) != 1) return 0;
  char buf[200 * 1000 + 13];
  scanf("%s\n", buf);
  s = buf;
  scanf("%s\n", buf);
  t = buf;
  return 1;
}
void solve() {
  memset(a, 255, sizeof(a));
  int res = 0;
  for (int i = 0; i < (n); i++) {
    a[s[i] - 'a'][t[i] - 'a'] = i;
    res += (s[i] != t[i]);
  }
  for (int i = 0; i < (26); i++)
    for (int j = 0; j < (26); j++) {
      if (i == j) continue;
      if (a[i][j] != -1 && a[j][i] != -1) {
        printf("%d\n", res - 2);
        printf("%d %d\n", a[i][j] + 1, a[j][i] + 1);
        return;
      }
    }
  for (int i = 0; i < (26); i++)
    for (int j = 0; j < (26); j++) {
      if (i == j) continue;
      for (int k = 0; k < (26); k++)
        if (k != i && a[i][j] != -1 && a[k][i] != -1) {
          printf("%d\n", res - 1);
          printf("%d %d\n", a[i][j] + 1, a[k][i] + 1);
          return;
        }
    }
  printf("%d\n", res);
  printf("-1 -1\n");
}
int main() {
  while (read()) solve();
  return 0;
}
