#include <bits/stdc++.h>
using namespace std;
int n, cnt, id, mn;
char a[600005];
int sum[600005], dep[600005], lef[600005], now[600005], sta[600005];
int top, l, r, ans, xx;
int main() {
  scanf("%d", &n);
  scanf("%s", a + 1);
  for (int i = 1; i <= n; i++) a[i + n] = a[i];
  cnt = 0;
  id = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < mn) mn = cnt, id = i + 1;
  }
  if (cnt != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  for (int i = id; i <= id + n - 1; i++) {
    if (a[i] == '(')
      sta[++top] = i;
    else {
      sum[i] = now[top];
      now[top] = 0;
      lef[i] = sta[top];
      top--;
      dep[i] = top;
      now[top]++;
    }
    if (top == 0) ans++;
  }
  xx = ans;
  l = r = 1;
  for (int i = id + 1; i <= id + n - 1; i++) {
    if (a[i] == ')') {
      if (dep[i] == 0 && sum[i] + 1 > ans) {
        ans = sum[i] + 1;
        l = lef[i];
        r = i;
      }
      if (dep[i] == 1 && sum[i] + xx + 1 > ans) {
        ans = sum[i] + xx + 1;
        l = lef[i];
        r = i;
      }
    }
  }
  printf("%d\n%d %d", ans, (l - 1) % n + 1, (r - 1) % n + 1);
  return 0;
}
