#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s, t;
  cin >> n;
  {
    map<pair<char, char>, int> m;
    int c1[27] = {0}, c2[27] = {0}, count = 0;
    cin >> s;
    cin >> t;
    int i, j, l = s.length(), tw = 0, p1 = -1, p2 = -1;
    for (i = 1; i <= l; i++) {
      if (s[i - 1] != t[i - 1]) {
        count++;
        c1[s[i - 1] - 'a'] = i;
        c2[t[i - 1] - 'a'] = i;
        if (tw != 2) {
          if (c2[s[i - 1] - 'a']) {
            p1 = c2[s[i - 1] - 'a'];
            p2 = i;
            tw = 1;
          } else if (c1[t[i - 1] - 'a']) {
            p1 = c1[t[i - 1] - 'a'];
            p2 = i;
            tw = 1;
          }
        }
        m[make_pair(s[i - 1], t[i - 1])] = i;
        if (m[make_pair(t[i - 1], s[i - 1])]) {
          p1 = m[make_pair(t[i - 1], s[i - 1])];
          p2 = i;
          tw = 2;
        }
      }
    }
    if (tw == 2)
      cout << count - 2 << "\n" << p1 << " " << p2 << "\n";
    else if (tw == 1)
      cout << count - 1 << "\n" << p1 << " " << p2 << "\n";
    else
      cout << count << "\n" << p1 << " " << p2 << "\n";
  }
  return 0;
}
