#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, i, j, k, index1, index2, visited;
  int test;
  int arr[27][27];
  for (i = 0; i < 27; i++)
    for (j = 0; j < 27; j++) arr[i][j] = 0;
  visited = 0;
  {
    cin >> n;
    string str1, str2;
    cin >> str1 >> str2;
    unsigned long long hamming = 0;
    for (int i = 0; i < n; i++) {
      if (str1[i] != str2[i]) {
        hamming++;
        if (arr[str1[i] - 'a'][str2[i] - 'a'] == 0)
          arr[str1[i] - 'a'][str2[i] - 'a'] = i + 1;
      }
    }
    for (i = 0; i < 27; i++) {
      for (j = 0; j < 27; j++) {
        if (arr[i][j] != 0) {
          if (arr[j][i] != 0) {
            index1 = arr[i][j];
            index2 = arr[j][i];
            visited = 2;
            goto ans;
          }
        }
      }
    }
    {
      for (i = 0; i < 27; i++) {
        for (j = 0; j < 27; j++) {
          if (arr[j][i] != 0) {
            for (k = 0; k < 27; k++) {
              if (arr[i][k] != 0) {
                index1 = arr[i][k];
                index2 = arr[j][i];
                visited = 1;
                goto ans;
              }
            }
          }
        }
      }
    }
  ans:
    if (visited == 2) {
      hamming = hamming - 2;
      cout << hamming << endl;
      cout << index1 << " " << index2 << endl;
    } else if (visited == 1) {
      hamming = hamming - 1;
      cout << hamming << endl;
      cout << index1 << " " << index2 << endl;
    } else {
      cout << hamming << endl;
      cout << -1 << " " << -1 << endl;
    }
  }
  return 0;
}
