#include <bits/stdc++.h>
using namespace std;
bool exists[26][26];
int main() {
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  int dist = 0;
  int minus = 0;
  int a, b, c, d;
  for (int i = 0; i < n; i++) {
    exists[s[i] - 'a'][t[i] - 'a'] = 1;
    if (s[i] != t[i]) dist++;
  }
  for (int i = 0; i < 26 && minus != 2; i++)
    for (int j = 0; j < 26 && minus != 2; j++)
      for (int k = 0; k < 26 && minus != 2; k++)
        for (int l = 0; l < 26 && minus != 2; l++)
          if (exists[i][j] && exists[k][l])
            if (i != j && k != l) {
              if (j == k) {
                a = i;
                b = j;
                c = k;
                d = l;
                minus = 1;
                if (i == l) {
                  minus++;
                  break;
                }
              }
            }
  if (minus == 0) {
    cout << dist << endl << -1 << " " << -1;
  } else {
    cout << dist - minus << endl;
    for (int i = 0; i < n; i++)
      if (s[i] == 'a' + a && t[i] == 'a' + b) {
        cout << i + 1 << " ";
        break;
      }
    for (int i = 0; i < n; i++)
      if (s[i] == 'a' + c && t[i] == 'a' + d) {
        cout << i + 1 << " ";
        break;
      }
  }
}
