#include <bits/stdc++.h>
using namespace std;
int main() {
  string S, T;
  int n;
  cin >> n;
  cin >> S;
  cin >> T;
  int ans, s[256][256];
  for (int i = 0; i < n; i++) ans += S[i] != T[i];
  for (int i = 0; i < n; i++)
    if (S[i] != T[i]) s[S[i] -= 'a'][T[i] -= 'a'] = i + 1;
  for (int i = 0; i < n; i++)
    if (S[i] != T[i] && s[T[i]][S[i]]) {
      cout << ans - 2 << '\n' << i + 1 << ' ' << s[T[i]][S[i]];
      return 0;
    }
  for (int i = 0; i < n; i++)
    if (S[i] != T[i])
      for (int j = 0; j < 26; j++)
        if (s[T[i]][j]) {
          cout << ans - 1 << '\n' << i + 1 << ' ' << s[T[i]][j];
          return 0;
        }
  cout << ans << '\n' << "-1 -1";
  return 0;
}
