#include <bits/stdc++.h>
char a[200007], b[200007];
int x[128][128];
int main() {
  int n, c = 0;
  scanf("%d%*c", &n);
  gets(a);
  gets(b);
  for (int i = 0; i < n; i++) {
    int t = a[i], u = b[i];
    if (t == u) continue;
    c++;
    x[t][u] = i + 1;
    x[t][0] = i + 1;
    x[0][u] = i + 1;
  }
  int q = 0;
  int t = -1, u = -1;
  for (int i = 'a'; i <= 'z'; i++) {
    for (int j = 'a'; j < i; j++) {
      if (x[i][j] && x[j][i]) {
        q = 2;
        t = x[i][j];
        u = x[j][i];
        goto aa;
      }
    }
  }
  for (int i = 'a'; i <= 'z'; i++) {
    if (x[i][0] && x[0][i]) {
      q = 1;
      t = x[i][0];
      u = x[0][i];
      goto aa;
    }
  }
aa:
  printf("%d\n%d %d\n", c - q, t, u);
  ;
  return 0;
}
