#include <bits/stdc++.h>
using namespace std;
int v[27][27];
int main() {
  ios_base::sync_with_stdio(false);
  int sz, ans = 0, m, k;
  string s, n;
  bool ok = 0;
  cin >> sz >> s >> n;
  for (int i = 0; i < sz; ++i)
    if (s[i] != n[i]) {
      v[s[i] - 'a'][n[i] - 'a'] = i + 1;
      if (v[n[i] - 'a'][s[i] - 'a']) {
        ok = true;
        m = v[s[i] - 'a'][n[i] - 'a'];
        k = v[n[i] - 'a'][s[i] - 'a'];
      }
      ++ans;
    }
  if (ok) {
    cout << ans - 2 << endl << m << " " << k;
    return 0;
  }
  for (int i = 0; i < 27; ++i)
    for (int j = 0; j < 27; ++j)
      if (v[i][j])
        for (int o = 0; o < 27; ++o)
          if (v[j][o]) {
            cout << ans - 1 << endl << v[i][j] << " " << v[j][o];
            return 0;
          }
  cout << ans << endl << "-1 -1";
}
