#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  unordered_map<char, int> mp;
  map<pair<char, char>, int> mc;
  int c = 0;
  for (int i = 0; i < n; i++)
    if (s[i] != t[i]) {
      mp[s[i]] = i + 1;
      mc[{s[i], t[i]}] = i + 1;
      c++;
    }
  int a = -1, b = -1;
  bool done = false;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      if (mc[{t[i], s[i]}]) {
        a = i + 1;
        b = mc[{t[i], s[i]}];
        c -= 2;
        done = true;
        break;
      }
    }
  }
  if (!done)
    for (int i = 0; i < n; i++) {
      if (s[i] != t[i]) {
        if (mp[t[i]]) {
          a = i + 1;
          b = mp[t[i]];
          c--;
          break;
        }
      }
    }
  cout << c << "\n";
  cout << a << " " << b << "\n";
  return 0;
}
