#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  int p1 = -1, p2 = -1;
  string s, t;
  int ham = 0;
  cin >> n;
  cin >> s >> t;
  for (int i = 0; i < (int)(((int)s.size())); ++i) ham += (s[i] != t[i]);
  for (char c1 = 'a'; c1 <= 'z'; c1++) {
    for (char c2 = 'a'; c2 <= 'z'; c2++) {
      if (c1 == c2) continue;
      p1 = -1, p2 = -1;
      for (int i = 0; i < ((int)s.size()) && p1 == -1; i++)
        if (s[i] == c1 && t[i] == c2) p1 = i;
      for (int i = 0; i < ((int)s.size()) && p2 == -1; i++)
        if (s[i] == c2 && t[i] == c1) p2 = i;
      if (p1 != -1 && p2 != -1) goto OUT1;
    }
  }
OUT1:
  if (p1 != -1 && p2 != -1) {
    cout << ham - 2 << endl;
    cout << p1 + 1 << " " << p2 + 1 << endl;
    return 0;
  }
  p1 = -1, p2 = -1;
  for (char c = 'a'; c <= 'z'; c++) {
    p1 = -1, p2 = -1;
    for (int i = 0; i < ((int)s.size()); i++) {
      if (s[i] == c && t[i] != c) p1 = i;
      if (s[i] != c && t[i] == c) p2 = i;
      if (p1 != -1 && p2 != -1) goto OUT2;
    }
  }
OUT2:
  if (p1 != -1 && p2 != -1) {
    cout << ham - 1 << endl;
    cout << p1 + 1 << " " << p2 + 1 << endl;
    return 0;
  }
  cout << ham << endl;
  cout << -1 << " " << -1 << endl;
  return 0;
}
