#include <bits/stdc++.h>
char s[200001], t[200001];
int p[26][26];
int main(void) {
  int n, hd = 0, p1 = 0, p2 = 0;
  scanf("%d %s %s", &n, s, t);
  for (int i = 0; i < n; i++)
    if (s[i] != t[i]) p[s[i] - 'a'][t[i] - 'a'] = i + 1, hd++;
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++)
      if (p[i][j])
        if (p[j][i]) {
          printf("%d\n%d %d", hd - 2, p[i][j], p[j][i]);
          return 0;
        } else
          for (int k = 0; k < 26; k++)
            if (p[k][i]) p1 = p[i][j], p2 = p[k][i];
  if (p1)
    printf("%d\n%d %d", hd - 1, p1, p2);
  else
    printf("%d\n-1 -1", hd);
}
