#include <bits/stdc++.h>
using namespace std;
const int maxn = 300005;
int n, s[maxn], a[maxn], b[maxn], sall, ans, al, ar, id[maxn];
void solve(int l, int r) {
  int ss = 0;
  for (int i = l; i <= r; i++) {
    if (a[i] == 2 && s[i] == 1) ss++;
  }
  if (ss + 1 > ans) ans = ss + 1, al = id[l], ar = id[r];
  int las = 0, s3 = 0;
  for (int i = l + 1; i <= r; i++) {
    if (a[i] == 2 && s[i] == 1)
      las = i, s3 = 0;
    else if (a[i] == 1) {
      if (s3 + 1 + sall > ans) ans = s3 + 1 + sall, al = id[las], ar = id[i];
    } else if (a[i] == 3 && s[i] == 1)
      s3++;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    char ch = getchar();
    while (ch != '(' && ch != ')') ch = getchar();
    if (ch == '(')
      s[i] = 1;
    else
      s[i] = -1;
    a[i] = a[i - 1] + s[i];
  }
  if (a[n] != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  int pl = 1;
  for (int i = 2; i <= n; i++)
    if (a[i] < a[pl]) pl = i;
  for (int i = 1; i <= pl; i++) b[i] = s[i];
  for (int i = pl + 1; i <= n; i++) s[i - pl] = s[i], id[i - pl] = i;
  for (int i = n - pl + 1; i <= n; i++)
    s[i] = b[i + pl - n], id[i] = i + pl - n;
  int las = 0;
  for (int i = 1; i <= n; i++) {
    a[i] = a[i - 1] + s[i];
    if (a[i] == 0) sall++;
  }
  ans = sall, al = 1, ar = 1;
  for (int i = 1; i <= n; i++)
    if (a[i] == 1 && s[i] == 1)
      las = i;
    else if (a[i] == 0)
      solve(las, i);
  printf("%d\n%d %d\n", ans, al, ar);
  return 0;
}
