#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, F = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') F = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * F;
}
int n, cnt, pos;
char s[800000 + 5];
int a[800000 + 5], sum[800000 + 5], siz[800000 + 5], stk[800000 + 5], tp;
int lp[800000 + 5], dep[800000 + 5];
int A, B, ans;
void update(int val, int x, int y) {
  if (val > ans) A = x, B = y, ans = val;
}
int main() {
  n = read();
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    a[n + i] = a[i] = (s[i] == '(') ? 1 : -1;
    cnt += a[i];
  }
  if (cnt) {
    printf("0\n1 1\n");
    return 0;
  }
  pos = 1;
  for (int i = 1; i <= n * 2; i++) {
    cnt += a[i];
    if (cnt < 0)
      pos = i + 1, cnt = 0;
    else if (i - pos + 1 >= n)
      break;
  }
  for (int i = pos; i <= n + pos - 1; i++) {
    if (a[i] == -1) {
      int x = stk[tp--];
      sum[tp]++;
      dep[i] = tp;
      siz[i] = sum[tp + 1];
      sum[tp + 1] = 0;
      lp[i] = x;
    } else
      stk[++tp] = i;
  }
  ans = sum[0];
  A = 1, B = 1;
  for (int i = pos; i <= n + pos - 1; i++)
    if (a[i] == -1) {
      if (!dep[i]) update(siz[i] + 1, lp[i], i);
      if (dep[i] == 1) update(sum[0] + siz[i] + 1, lp[i], i);
    }
  printf("%d\n%d %d\n", ans, (A - 1) % n + 1, (B - 1) % n + 1);
}
