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