#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int N = 110;
int n, k, m, res;
int d[N][N], arr[N];
string s, t;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  cin >> s >> t;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      d[s[i] - 'a'][t[i] - 'a'] = i + 1;
      arr[t[i] - 'a'] = i + 1;
      res++;
    }
  }
  for (int i = 0; i < 30; i++)
    for (int j = 0; j < 30; j++)
      if (d[i][j] && d[j][i]) {
        cout << res - 2 << '\n';
        cout << d[i][j] << " " << d[j][i];
        return 0;
      }
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i] && arr[s[i] - 'a']) {
      cout << res - 1 << '\n';
      cout << i + 1 << " " << arr[s[i] - 'a'];
      return 0;
    }
  }
  cout << res << '\n';
  cout << -1 << " " << -1;
  return 0;
}
