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