#include <bits/stdc++.h>
using namespace std;
const int maxn = 600010;
int n, a[maxn], ansi, ansj, ans, rt, pos[maxn], cnt, mat[maxn], sta[maxn], top,
    ins[maxn];
char str[maxn];
void calc(int l, int r) {
  for (int i = l + 1; i < r; i = mat[i] + 1)
    if (ins[i] + cnt + 1 > ans) ans = ins[i] + cnt + 1, ansi = i, ansj = mat[i];
  if (ins[l] + 1 > ans) ans = ins[l] + 1, ansi = l, ansj = r;
}
int main() {
  scanf("%d", &n);
  scanf("%s", str + 1);
  int leftnum = 0;
  for (int i(1), i_ORZ(n); i <= i_ORZ; i++)
    if (str[i] == '(')
      a[i] = 1, leftnum++;
    else
      a[i] = -1;
  if (n % 2 || leftnum != n / 2) {
    printf("0\n1 1\n");
    return 0;
  }
  for (int i(1), i_ORZ(n); i <= i_ORZ; i++) a[i + n] = a[i];
  for (int i = 1; i <= n;) {
    int j = i, s = 0;
    cnt = 0;
    for (; j <= i + n - 1; j++) {
      s += a[j];
      if (s == 0) pos[++cnt] = j;
      if (s < 0) break;
    }
    if (j <= i + n - 1)
      i = j + 1;
    else if (s)
      i += s;
    else {
      rt = i;
      break;
    }
  }
  ans = cnt;
  ansi = ansj = 1;
  pos[0] = rt - 1;
  for (int i(rt), i_ORZ(rt + n - 1); i <= i_ORZ; i++) {
    if (a[i] > 0)
      sta[++top] = i;
    else
      mat[i] = sta[top], mat[sta[top]] = i, top--;
  }
  for (int i(rt), i_ORZ(rt + n - 1); i <= i_ORZ; i++) {
    if (ins[i]) continue;
    int res = 0;
    for (int j = i + 1; j < mat[i]; j = mat[j] + 1) res++;
    ins[i] = ins[mat[i]] = res;
  }
  for (int i(1), i_ORZ(cnt); i <= i_ORZ; i++) calc(pos[i - 1] + 1, pos[i]);
  if (ansi > n) ansi -= n;
  if (ansj > n) ansj -= n;
  cout << ans << endl;
  cout << ansi << ' ' << ansj << endl;
  return 0;
}
