#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxn = 200000 + 100;
char str1[maxn], str2[maxn];
int mp[30][30];
int n;
int main() {
  while (~scanf("%d", &n)) {
    int cnt = 0, flag = 0;
    memset(mp, 0, sizeof mp);
    scanf("%s%s", str1, str2);
    for (int i = 0; i < n; ++i) {
      if (str1[i] != str2[i]) cnt++, mp[str1[i] - 'a'][str2[i] - 'a'] = i + 1;
    }
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        if (mp[i][j] && mp[j][i]) {
          printf("%d\n", cnt - 2);
          flag = 1;
          printf("%d %d\n", mp[i][j], mp[j][i]);
          break;
        }
      }
      if (flag) break;
    }
    if (flag) continue;
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        if (mp[i][j]) {
          for (int k = 0; k < 26; k++)
            if (mp[j][k]) {
              printf("%d\n", cnt - 1);
              flag = 1;
              printf("%d %d\n", mp[i][j], mp[j][k]);
              break;
            }
        }
      }
      if (flag) break;
    }
    if (flag) continue;
    printf("%d\n", cnt);
    printf("%d %d\n", -1, -1);
  }
  return 0;
}
