#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
const double pi = acos(-1.0);
const double ee = exp(1.0);
char s[maxn], t[maxn];
int pos[30][30];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s%s", s, t);
  int cnt = 0;
  memset(pos, -1, sizeof(pos));
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      pos[s[i] - 'a'][t[i] - 'a'] = i;
      cnt++;
    }
  }
  if (cnt == 1)
    printf("1\n-1 -1\n");
  else if (cnt == 0)
    printf("0\n-1 -1\n");
  else {
    int ans1 = -1, ans2 = -1;
    int flag = 0;
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        for (int k = 0; k < 26; k++) {
          if (pos[i][j] != -1 && pos[k][i] != -1) {
            ans1 = pos[i][j];
            ans2 = pos[k][i];
            if (j != k) {
              flag = 1;
            } else {
              flag = 2;
              break;
            }
          }
        }
        if (flag == 2) break;
      }
      if (flag == 2) break;
    }
    if (flag == 0)
      printf("%d\n-1 -1\n", cnt);
    else
      printf("%d\n%d %d\n", cnt - flag, ans1 + 1, ans2 + 1);
  }
  return 0;
}
