#include <bits/stdc++.h>
using namespace std;
int n;
char s[600010];
int stk[300010], top = 0, dep[600010], sum[600010], p[600010], ss[600010],
                 ans = 0, l = 1, r = 1;
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) s[i + n] = s[i];
  int mn = 0, cnt = 0, x = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < mn) mn = cnt, x = i;
  }
  if (cnt) {
    printf("0\n1 1");
    return 0;
  }
  x++;
  for (int i = x; i <= x + n - 1; i++) {
    if (s[i] == '(')
      stk[++top] = i;
    else {
      ss[i] = sum[top];
      sum[top] = 0;
      p[i] = stk[top--];
      dep[i] = top;
      sum[top]++;
    }
    if (top == 0) ans++;
  }
  int tx = ans;
  for (int i = x + 1; i <= x + n - 1; i++) {
    if (s[i] == ')') {
      if (dep[i] == 0 && ss[i] + 1 > ans) ans = ss[i] + 1, l = p[i], r = i;
      if (dep[i] == 1 && ss[i] + tx + 1 > ans)
        ans = ss[i] + tx + 1, l = p[i], r = i;
    }
  }
  printf("%d\n%d %d", ans, (l - 1) % n + 1, (r - 1) % n + 1);
  return 0;
}
