#include <bits/stdc++.h>
using namespace std;
map<int, int> vis[26];
char s1[210000], s2[210000];
int main() {
  int len;
  while (scanf("%d%s%s", &len, s1, s2) != EOF) {
    for (int i = 0; i < 26; i++)
      for (int j = 0; j < 26; j++) vis[i].clear();
    int changei = -1, changej = -1;
    int sum = 0;
    for (int i = 0; i < len; i++)
      if (s1[i] != s2[i]) sum++;
    for (int i = 0; i < len; i++) {
      if (s1[i] == s2[i]) continue;
      if (!vis[s1[i] - 'a'].count(s2[i] - 'a'))
        vis[s1[i] - 'a'][s2[i] - 'a'] = i;
      if (vis[s2[i] - 'a'].count(s1[i] - 'a')) {
        changei = i;
        changej = vis[s2[i] - 'a'][s1[i] - 'a'];
        break;
      }
    }
    if (changei != -1) {
      printf("%d\n%d %d\n", sum - 2, changei + 1, changej + 1);
    } else {
      int ok = 0;
      for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 26; j++) {
          if (vis[i].count(j)) {
            for (int k = 0; k < 26; k++) {
              if (vis[j].count(k)) {
                ok = 1;
                changei = vis[i][j] + 1;
                changej = vis[j][k] + 1;
                break;
              }
            }
            if (ok) break;
          }
        }
        if (ok) break;
      }
      if (ok) sum -= 1;
      printf("%d\n%d %d\n", sum, changei, changej);
    }
  }
  return 0;
}
