#include <bits/stdc++.h>
using namespace std;
const int N = 6e5 + 5, INF = 0x3f3f3f3f;
int n;
char a[N];
int s[N];
int main() {
  scanf("%d %s", &n, a + 1);
  int r1 = 1, r2 = 1, ans = 0, p = 0, t = 0, mn = INF;
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1] + (a[i] == '(' ? 1 : -1);
    s[i] < mn ? mn = s[i], p = i : 0;
  }
  if (s[n]) puts("0\n 1 1"), exit(0);
  for (int i = 1; i <= n; i++) a[i + n] = a[i];
  for (int i = 1; i <= n; i++)
    s[i] = s[i - 1] + (a[i + p] == '(' ? 1 : -1), t += !s[i];
  for (int i = 1, j; i <= n; i = j + 1) {
    int s1 = 0, s2 = 0, ss = 0, p1 = 0, p2 = 0, ls = i;
    for (j = i;; j++) {
      if (s[j] == 1) {
        if (s2 > ss) ss = s2, p1 = ls + 1, p2 = j;
        s2 = 0, s1++, ls = j;
      } else if (s[j] == 2)
        s2++;
      if (j == n || !s[j]) break;
    }
    if (s2 > ss) ss = s2, p1 = ls + 1, p2 = j;
    if (s1 > ans) ans = s1, r1 = i, r2 = j;
    if (t + ss > ans) ans = t + ss, r1 = p1, r2 = p2;
  }
  printf("%d\n%d %d\n", ans, (p + r1 - 1) % n + 1, (p + r2 - 1) % n + 1);
}
