#include <bits/stdc++.h>
using namespace std;
const int maxn = 300003;
int n, stk[maxn], sum[maxn], sum1[maxn];
char s[maxn], t[maxn];
int main() {
  scanf("%d%s", &n, s);
  int tot0 = 0, tot1 = 0;
  for (int i = 0; i < n; i++) (s[i] == '(' ? tot0 : tot1)++;
  if (tot0 != tot1) {
    printf("0\n1 1");
    return 0;
  }
  strcpy(t, s);
  int mi = maxn, pos = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    s[i] == '(' ? cur++ : cur--;
    if (s[i] == '(' && cur < mi) mi = cur, pos = i;
  }
  for (int i = 0; i < n; i++) s[i] = t[(i + pos) % n];
  int ans = 0, mx = 0, ans1 = 0;
  for (int i = 0; i < n; i++) {
    s[i] == '(' ? cur++ : cur--;
    if (cur == 0) ans++;
  }
  int ANS = ans, ANS1 = 1, ANS2 = 1;
  for (int i = 0; i < n; i++) {
    if (i) sum[i] = sum[i - 1], sum1[i] = sum1[i - 1];
    if (s[i] == '(')
      stk[++cur] = i;
    else {
      int pre = stk[cur--];
      if (cur == 2) {
        sum[i]++;
      }
      if (cur == 1) {
        sum1[i]++;
        mx = max(mx, sum[i] - sum[pre] + 1);
        if (ans + mx > ANS)
          ANS = ans + mx, ANS1 = (pre + pos) % n + 1, ANS2 = (i + pos) % n + 1;
      }
      if (cur == 0) {
        ans1 = max(ans1, sum1[i] - sum1[pre] + 1);
        if (ans1 > ANS)
          ANS = ans1, ANS1 = (pre + pos) % n + 1, ANS2 = (i + pos) % n + 1;
      }
    }
  }
  printf("%d\n%d %d", ANS, ANS1, ANS2);
  return 0;
}
