#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  map<pair<char, char>, int> m;
  map<char, int> oia;
  int n, dist = 0;
  string s, t;
  cin >> n;
  cin >> s;
  cin >> t;
  for (int i = 0; i < n; i++)
    if (s[i] != t[i]) {
      m[make_pair(s[i], t[i])] = i;
      oia[s[i]] = i;
      dist++;
    }
  int melhor = 0;
  pair<int, int> resp = make_pair(-1, -1);
  for (map<pair<char, char>, int>::iterator it = m.begin(); it != m.end();
       it++) {
    if (m.find(make_pair(it->first.second, it->first.first)) != m.end()) {
      melhor = 2;
      resp = make_pair(it->second + 1,
                       m[make_pair(it->first.second, it->first.first)] + 1);
      break;
    }
    if (oia.find(it->first.second) != oia.end()) {
      melhor = 1;
      resp = make_pair(it->second + 1, oia[it->first.second] + 1);
    }
  }
  cout << dist - melhor << "\n";
  cout << resp.first << " " << resp.second << "\n";
  return 0;
}
