#include <bits/stdc++.h>
using namespace std;
int hahahha[40][40];
int hh[40];
char mama[200010], alal[200010];
int main() {
  int lenwa;
  cin >> lenwa;
  cin >> mama >> alal;
  int hm = 0;
  for (int i = 0; i < lenwa; i++) {
    if (mama[i] != alal[i]) {
      hh[alal[i] - 'a'] = i + 1;
      hahahha[mama[i] - 'a'][alal[i] - 'a'] = i + 1;
      hm++;
    }
  }
  for (int i = 0; i < lenwa; i++) {
    if (mama[i] != alal[i]) {
      if (hahahha[alal[i] - 'a'][mama[i] - 'a'] != 0) {
        cout << hm - 2 << endl;
        cout << i + 1 << " " << hahahha[alal[i] - 'a'][mama[i] - 'a'];
        return 0;
      }
    }
  }
  for (int i = 0; i < lenwa; i++) {
    if (mama[i] != alal[i]) {
      if (hh[mama[i] - 'a'] != 0) {
        cout << hm - 1 << endl;
        if (i + 1 < hh[mama[i] - 'a'])
          cout << i + 1 << " " << hh[mama[i] - 'a'] << endl;
        else
          cout << hh[mama[i] - 'a'] << " " << i + 1 << endl;
        return 0;
      }
    }
  }
  cout << hm << endl;
  cout << "-1"
       << " "
       << "-1" << endl;
  return 0;
}
