#include <bits/stdc++.h>
using namespace std;
stack<time_t> time_stack;
void startTimer() { time_stack.push(clock()); }
double stopTimer() {
  double time = clock() - time_stack.top();
  time_stack.pop();
  return time / double(CLOCKS_PER_SEC);
}
int main() {
  ios::sync_with_stdio(false);
  int a[256][256];
  for (int i = 0; i < 256; i++)
    for (int j = 0; j < 256; j++) a[i][j] = -1;
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < n; i++)
    if (s[i] != t[i] && a[s[i]][t[i]] == -1) a[s[i]][t[i]] = i;
  pair<int, int> ans(-2, -2);
  for (int i = 0; i < n; i++)
    if (s[i] != t[i])
      for (int j = 'a'; j <= 'z'; j++)
        if (a[t[i]][j] != -1 && j != t[i]) {
          ans.first = i;
          ans.second = a[t[i]][j];
          break;
        }
  for (int i = 0; i < n; i++)
    if (s[i] != t[i] && a[t[i]][s[i]] != -1) {
      ans.first = i;
      ans.second = a[t[i]][s[i]];
      break;
    }
  if (ans.first != -2) swap(s[ans.first], s[ans.second]);
  int sum = 0;
  for (int i = 0; i < n; i++)
    if (s[i] != t[i]) sum++;
  cout << sum << endl;
  cout << ans.first + 1 << " " << ans.second + 1 << endl;
  return 0;
}
