#include <bits/stdc++.h>
const int MAXN = 3e5 + 5;
char s[MAXN];
char s2[MAXN];
int sum[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s + 1);
  int cnt = 0, mval = 1, mid;
  for (int i = 1; i <= n; ++i) {
    int tmp = s[i] == '(' ? 1 : -1;
    sum[i] = sum[i - 1] + tmp;
    cnt += tmp;
    if (sum[i] < mval) {
      mval = sum[i];
      mid = i;
    }
  }
  if (cnt) {
    printf("0\n1 1");
    return 0;
  }
  int ans[3] = {0, 1, 1};
  int tmp = mid;
  for (int i = 1; i <= n; ++i) {
    if (tmp == n) tmp = 0;
    s2[i] = s[++tmp];
    sum[i] = sum[i - 1] + (s2[i] == '(' ? 1 : -1);
    if (!sum[i]) ++ans[0];
  }
  tmp = 1;
  int tmp2 = ans[0];
  for (int i = 1; i <= n; ++i)
    if (sum[i] == 0) {
      if (cnt > ans[0]) {
        ans[0] = cnt;
        ans[1] = tmp;
        ans[2] = i;
      }
      tmp = i + 1;
      cnt = 0;
    } else if (sum[i] == 1)
      ++cnt;
  for (int i = 1; i <= n; ++i)
    if (sum[i] < 2) {
      if (cnt + tmp2 > ans[0]) {
        ans[0] = cnt + tmp2;
        ans[1] = tmp;
        ans[2] = i;
      }
      tmp = i + 1;
      cnt = 0;
    } else if (sum[i] == 2)
      ++cnt;
  printf("%d\n%d %d", ans[0], (mid + ans[1] - 1) % n + 1,
         (mid + ans[2] - 1) % n + 1);
  return 0;
}
