#include <bits/stdc++.h>
using namespace std;
char a[300000], b[300000];
int m[256][256] = {{0}};
int main() {
  int n, cnt = 0, reduce = 0;
  scanf("%d%s%s", &n, a, b);
  pair<int, int> ans(-1, -1);
  for (int i = 0; i < n; i++)
    if (a[i] != b[i]) {
      switch (reduce) {
        case 0:
          if (m[b[i]][a[i]] != 0) {
            reduce = 2;
            ans.first = m[b[i]][a[i]];
            ans.second = i + 1;
          } else {
            for (int j = 'a'; j <= 'z'; j++) {
              if (m[j][a[i]] != 0) {
                reduce = 1;
                ans.first = m[j][a[i]];
                ans.second = i + 1;
              } else if (m[b[i]][j] != 0) {
                reduce = 1;
                ans.first = m[b[i]][j];
                ans.second = i + 1;
              }
            }
          }
          break;
        case 1:
          if (m[b[i]][a[i]] != 0) {
            reduce = 2;
            ans.first = m[b[i]][a[i]];
            ans.second = i + 1;
          }
      }
      cnt++;
      m[a[i]][b[i]] = i + 1;
    }
  printf("%d\n%d %d\n", cnt - reduce, ans.first, ans.second);
}
