#include <bits/stdc++.h>
using namespace std;
int n;
char str[600010];
int prefix[600010];
int ans, ansl, ansr;
int main() {
  cin >> n;
  cin >> str;
  for (int i = 1; i <= n; ++i) {
    prefix[i] = prefix[i - 1] + (str[i - 1] == '(' ? 1 : -1);
    prefix[i + n] = prefix[i];
  }
  if (prefix[n] != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  int min_v = n + 1, min_idx = -1;
  for (int i = 1; i <= n; ++i) {
    if (prefix[i] < min_v) {
      min_v = prefix[i];
      min_idx = i;
    }
  }
  int ans0 = 0;
  for (int i = 1; i <= n; ++i) {
    if (prefix[i] == min_v) {
      ans0++;
    }
  }
  ans = ans0;
  ansl = 1;
  ansr = 1;
  for (int i = min_idx; i <= min_idx + n - 1;) {
    int j = i + 1, cnt = 0;
    while (prefix[j] >= min_v + 2) {
      if (prefix[j] == min_v + 2) {
        ++cnt;
      }
      ++j;
    }
    if (i + 1 < j) {
      if (ans0 + cnt > ans) {
        ans = ans0 + cnt;
        ansl = i + 1;
        ansr = j;
      }
    }
    i = j;
  }
  for (int i = min_idx; i <= min_idx + n - 1;) {
    int j = i + 1, cnt = 0;
    while (prefix[j] >= min_v + 1) {
      if (prefix[j] == min_v + 1) {
        ++cnt;
      }
      ++j;
    }
    if (i + 1 < j) {
      if (cnt > ans) {
        ans = cnt;
        ansl = i + 1;
        ansr = j;
      }
    }
    i = j;
  }
  if (ansl > n) ansl -= n;
  if (ansr > n) ansr -= n;
  printf("%d\n%d %d\n", ans, ansl, ansr);
  return 0;
}
