#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  bool b[26][26] = {0}, b1[26] = {0};
  long c = 0;
  for (long i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      c++;
      b[t[i] - 'a'][s[i] - 'a'] = 1;
      b1[t[i] - 'a'] = 1;
    }
  }
  if (c <= 1) {
    cout << c << "\n" << -1 << " " << -1;
    return 0;
  }
  char x = '0', y = '0';
  for (long i = 0; i <= 25; i++) {
    for (long j = 0; j <= 25; j++) {
      if (b[i][j] && b[j][i]) {
        x = char(i + 'a');
        y = char(j + 'a');
        break;
      }
    }
  }
  if (x != '0') {
    long p, q;
    for (long i = 0; i < n; i++) {
      if (s[i] == x && t[i] == y) p = i;
      if (s[i] == y && t[i] == x) q = i;
    }
    cout << c - 2 << "\n" << p + 1 << " " << q + 1;
    return 0;
  }
  for (long i = 0; i <= 25; i++) {
    if (b1[i]) {
      for (long j = 0; j <= 25; j++) {
        if (b[j][i]) {
          x = char(i + 'a');
        }
      }
    }
  }
  if (x != '0') {
    long p, q;
    for (long i = 0; i < n; i++) {
      if (t[i] == x && s[i] != x) p = i;
      if (s[i] == x && t[i] != x) q = i;
    }
    cout << c - 1 << "\n" << p + 1 << " " << q + 1;
    return 0;
  }
  cout << c << "\n" << -1 << " " << -1;
}
