#include <bits/stdc++.h>
using namespace std;
int arr[27][27];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  vector<long long int> p[27], q[27];
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      ans++;
      p[s1[i] - 'a' + 1].push_back(i);
      q[s2[i] - 'a' + 1].push_back(i);
      arr[s1[i] - 'a' + 1][s2[i] - 'a' + 1] = i + 1;
    }
  }
  if (ans == 0 || ans == 1) {
    cout << ans << endl;
    cout << "-1 -1" << endl;
  } else {
    long long int x, y;
    for (int i = 1; i <= 26; i++) {
      for (int j = 1; j <= 26; j++) {
        if (arr[i][j] != 0 && arr[j][i] != 0) {
          ans -= 2;
          cout << ans << endl;
          cout << arr[i][j] << " " << arr[j][i] << endl;
          return 0;
        }
      }
    }
    for (int i = 1; i <= 26; i++) {
      if (p[i].size() != 0 && q[i].size() != 0) {
        cout << ans - 1 << endl;
        cout << p[i][0] + 1 << " " << q[i][0] + 1 << endl;
        return 0;
      }
    }
    cout << ans << endl;
    cout << "-1 -1" << endl;
  }
  return 0;
}
