#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s, t;
  cin >> n >> s >> t;
  map<char, int> si;
  map<pair<char, char>, int> st;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      si[s[i]] = i + 1;
      st[make_pair(s[i], t[i])] = i + 1;
    }
  }
  int x = -1, y = -1, ans;
  for (int i = 0; i < n; i++) {
    ans = st[make_pair(t[i], s[i])];
    if (s[i] != t[i] && ans) {
      x = i + 1;
      y = ans;
      swap(s[x - 1], s[y - 1]);
      break;
    }
  }
  if (x == -1) {
    for (int i = 0; i < n; i++) {
      if (s[i] != t[i] && si[t[i]]) {
        x = i + 1;
        y = si[t[i]];
        swap(s[x - 1], s[y - 1]);
        break;
      }
    }
  }
  ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      ans++;
    }
  }
  cout << ans << endl << x << ' ' << y;
  return 0;
}
