#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int s[N], ans, o1, o2, lst[N], n, l[N], r[N], cnum[N];
char S[N], a[N];
int main() {
  scanf("%d%s", &n, S + 1);
  register int i, mn = 0, pos = 0, cn = 0, top = 0;
  for (i = 1; i <= n; ++i)
    s[i] = s[i - 1] + (S[i] == '(' ? 1 : -1), s[i] < mn ? mn = s[i],
    pos = i : 0;
  if (s[n]) return puts("0"), printf("1 1"), 0;
  for (i = pos + 1; i <= n; ++i) a[++cn] = S[i];
  for (i = 1; i < pos; ++i) a[++cn] = S[i];
  for (i = 1, cn = 0; i <= n; ++i)
    a[i] == '(' ? s[++top] = ++cn, l[cn] = i
                : (r[s[top]] = i, lst[s[top]] = s[top - 1], ++cnum[s[--top]]);
  for (i = 1, ans = cnum[0], o1 = o2 = 1; i <= cn; ++i)
    cnum[i] + 1 > ans && (!lst[i])
        ? ans = cnum[i] + 1,
          o1 = l[i],
          o2 = r[i]
        : (cnum[0] + cnum[i] + 1 > ans && lst[i] && (!lst[lst[i]])
           ? ans = cnum[0] + cnum[i] + 1,
           o1 = l[i], o2 = r[i] : 0);
  o1 += pos, o2 += pos, o1 > n ? o1 -= n : 0, o2 > n ? o2 -= n : 0;
  printf("%d\n%d %d", ans, o1, o2);
  return 0;
}
