#include <bits/stdc++.h>
using namespace std;
string s, t;
int a[30][30], mark[30], mark2[30];
int main() {
  int n, i, p, cnt, ans, ans1;
  cin >> n;
  cin >> s >> t;
  p = 0;
  cnt = 0;
  for (i = 0; i < n; i++) {
    if (s[i] != t[i])
      cnt++;
    else
      continue;
    if (mark[t[i] - 'a'] > 0 && a[t[i] - 'a'][s[i] - 'a'] > 0) {
      if (p < 2) {
        p = 2;
        ans = i;
        ans1 = a[t[i] - 'a'][s[i] - 'a'];
      }
    } else if (mark[t[i] - 'a'] > 0) {
      if (p < 1) {
        p = 1;
        ans = i;
        ans1 = mark[t[i] - 'a'];
      }
    } else if (mark2[s[i] - 'a'] > 0) {
      if (p < 1) {
        p = 1;
        ans = i;
        ans1 = mark2[s[i] - 'a'];
      }
    }
    mark[s[i] - 'a'] = i + 1;
    mark2[t[i] - 'a'] = i + 1;
    a[s[i] - 'a'][t[i] - 'a'] = i + 1;
  }
  if (p == 0) {
    cout << cnt << endl;
    cout << -1 << " " << -1;
  } else if (p == 1) {
    cout << cnt - 1 << endl;
    cout << ans1 << " " << ans + 1;
  } else if (p == 2) {
    cout << cnt - 2 << endl;
    cout << ans1 << " " << ans + 1;
  }
  return 0;
}
