#include <bits/stdc++.h>
using namespace std;
int n, a[300005], L, R, ans, base, top, pre[300005], lst[300005], pos, num,
    p[300005], c[300005];
pair<int, int> sta[300005];
char s[300005], t[300005];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      num++;
    else
      num--;
  }
  if (num != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) a[i] = a[i - 1] + ((s[i] == '(') ? 1 : -1);
  pre[0] = lst[n + 1] = n + 1;
  for (int i = 1; i <= n; i++) pre[i] = min(pre[i - 1], a[i]);
  for (int i = n; i >= 1; i--) lst[i] = min(lst[i + 1], a[i]);
  L = R = 1;
  ans = 0;
  for (int i = 1; i <= n; i++) {
    if (pre[i] + 0 - a[i] < 0 || lst[i + 1] - a[i] < 0) continue;
    ans++;
    pos = i;
  }
  int cnt = 0;
  for (int i = pos + 1; i <= n; i++) t[++cnt] = s[i], p[cnt] = i;
  for (int i = 1; i <= pos; i++) t[++cnt] = s[i], p[cnt] = i;
  top = 0;
  base = ans;
  for (int i = 1; i <= n; i++) {
    sta[++top] = pair<int, int>(t[i], p[i]);
    if (top >= 2 && sta[top].first == ')' && sta[top - 1].first == '(') {
      top -= 2;
      c[sta[top].second]++;
      if (top == 0 && ans < c[sta[1].second] + 1) {
        ans = c[sta[1].second] + 1;
        L = sta[1].second;
        R = sta[2].second;
      } else if (top == 1 && ans < base - 1 + 2 + c[sta[2].second]) {
        ans = c[sta[2].second] + base + 1;
        L = sta[2].second;
        R = sta[3].second;
      }
    }
  }
  printf("%d\n", ans);
  printf("%d %d\n", L, R);
}
