#include <bits/stdc++.h>
using namespace std;
const int N = 200002;
struct node {
  int a, b;
  node() {}
  node(int _a, int _b) { a = _a, b = _b; }
  bool operator<(const node &rhs) const {
    if (a != rhs.a) return a < rhs.a;
    if (b != rhs.b) return b < rhs.b;
    return false;
  }
};
int main() {
  int n;
  char s[N], t[N];
  scanf("%d%s%s", &n, s, t);
  vector<int> v;
  int f1[26] = {}, f2[26] = {};
  int dis = 0;
  map<node, int> mmap;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      mmap[node(s[i], t[i])] = i;
      f1[s[i] - 'a'] = i + 1;
      f2[t[i] - 'a'] = i + 1;
      dis++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      if (mmap.find(node(t[i], s[i])) != mmap.end()) {
        printf("%d\n", dis - 2);
        printf("%d %d\n", i + 1, mmap[node(t[i], s[i])] + 1);
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      if (f1[t[i] - 'a']) {
        printf("%d\n", dis - 1);
        printf("%d %d\n", f1[t[i] - 'a'], i + 1);
        return 0;
      }
      if (f2[s[i] - 'a']) {
        printf("%d\n", dis - 1);
        printf("%d %d\n", f2[s[i] - 'a'], i + 1);
        return 0;
      }
    }
  }
  printf("%d\n-1 -1\n", dis);
  return 0;
}
