#include <bits/stdc++.h>
using namespace std;
long long pos[255];
long long arr[255][255];
int main() {
  long long n, cnt = 0;
  string s, t;
  cin >> n >> s >> t;
  memset(arr, 0, sizeof arr);
  for (long long i = 0; i < n; i++)
    if (s[i] != t[i]) cnt++, arr[s[i]][t[i]] = i + 1, pos[s[i]] = i + 1;
  long long ind1 = -1, ind2 = -1, flag = 0;
  for (long long i = 'a'; i <= 'z' && !flag; i++)
    for (long long j = 'a'; j <= 'z'; j++)
      if (arr[i][j] && arr[j][i]) {
        cnt -= 2, ind1 = arr[i][j], ind2 = arr[j][i], flag = 1;
        break;
      }
  for (long long i = 'a'; i <= 'z' && !flag; i++)
    for (long long j = 'a'; j <= 'z'; j++)
      if (arr[i][j] && pos[j]) {
        cnt--, ind1 = arr[i][j], ind2 = pos[j], flag = 1;
        break;
      }
  cout << cnt << "\n" << ind1 << " " << ind2 << "\n";
  return 0;
}
