#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[200003], t[200003];
  int i, l, cnt1[28], cnt2[28], m[28][28];
  memset(cnt1, -1, sizeof(cnt1));
  memset(cnt2, -1, sizeof(cnt2));
  memset(m, -1, sizeof(m));
  cin >> l;
  cin >> s >> t;
  int c = 0;
  l, i;
  for (i = 0; i < l; i++)
    if (s[i] != t[i]) {
      c++;
      m[s[i] - 'a'][t[i] - 'a'] = i;
      cnt1[s[i] - 'a'] = i;
      cnt2[t[i] - 'a'] = i;
    }
  for (i = 0; i < l; i++) {
    if (m[s[i] - 'a'][t[i] - 'a'] >= 0 && m[t[i] - 'a'][s[i] - 'a'] >= 0) {
      cout << c - 2 << "\n";
      cout << m[s[i] - 'a'][t[i] - 'a'] + 1 << " "
           << m[t[i] - 'a'][s[i] - 'a'] + 1;
      return 0;
    }
  }
  for (i = 0; i < 26; i++)
    if (cnt1[i] >= 0 && cnt2[i] >= 0) {
      cout << c - 1 << "\n";
      cout << cnt1[i] + 1 << " " << cnt2[i] + 1;
      return 0;
    }
  cout << c << "\n";
  cout << -1 << " " << -1;
}
