#include <bits/stdc++.h>
using namespace std;
bool b[123][123];
int arr[123][123];
int k[123];
int z[123];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  bool valid = 0, flag = 0;
  pair<int, int> ans1, ans2;
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != t[i]) {
      if (b[t[i] - 'a'][s[i] - 'a']) {
        ans2 = make_pair(arr[t[i] - 'a'][s[i] - 'a'] + 1, i + 1);
        flag = 1;
        break;
      }
      if (!valid) {
        if (z[t[i] - 'a'] == 1) {
          ans1 = make_pair(k[t[i] - 'a'] + 1, i + 1);
          valid = 1;
        } else if (z[s[i] - 'a'] == 2) {
          ans1 = make_pair(k[s[i] - 'a'] + 1, i + 1);
          valid = 1;
        }
      }
      z[s[i] - 'a'] = 1;
      z[t[i] - 'a'] = 2;
      k[s[i] - 'a'] = i;
      k[t[i] - 'a'] = i;
      b[s[i] - 'a'][t[i] - 'a'] = 1;
      arr[s[i] - 'a'][t[i] - 'a'] = i;
    }
  }
  int h = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != t[i]) h++;
  }
  if (flag) {
    cout << h - 2 << endl;
    cout << ans2.first << " " << ans2.second << endl;
  } else if (valid) {
    cout << h - 1 << endl;
    cout << ans1.first << " " << ans1.second << endl;
  } else {
    cout << h << endl;
    cout << "-1"
         << " "
         << "-1" << endl;
  }
  return 0;
}
