#include <bits/stdc++.h>
using namespace std;
const int maxn = 7e5;
char s[1000010];
int t, now, n, ans = 0, f[maxn], pr[2], l[2], r[2], q[2], cnt[2];
int main() {
  scanf("%d", &n);
  t = 0;
  now = 1;
  for (int i = 1; i <= n; i++) {
    scanf(" %c", &s[i]);
    s[i + n] = s[i];
    if (s[i] == '(') cnt[0]++;
    if (s[i] == ')') cnt[1]++;
    if (cnt[0] - cnt[1] < now) {
      now = cnt[0] - cnt[1];
      t = (i % n + 1);
    }
  }
  if (cnt[0] != cnt[1]) {
    printf("0\n");
    printf("1 1\n");
    return 0;
  }
  f[t - 1] = 0;
  cnt[0] = cnt[1] = 0;
  q[0] = q[1] = 0;
  pr[0] = pr[1] = t;
  l[0] = r[0] = l[1] = r[1] = 1;
  for (int i = t; i <= t + n; i++) {
    if (s[i] == '(') f[i] = f[i - 1] + 1;
    if (s[i] == ')') f[i] = f[i - 1] - 1;
    if (f[i] == 2) cnt[1]++;
    if (f[i] == 1) {
      cnt[0]++;
      if (q[1] < cnt[1]) {
        q[1] = cnt[1];
        l[1] = pr[1];
        r[1] = i;
      }
      cnt[1] = 0;
      pr[1] = i + 1;
    }
    if (f[i] == 0) {
      if (q[0] < cnt[0]) {
        q[0] = cnt[0];
        l[0] = pr[0];
        r[0] = i;
      }
      cnt[0] = 0;
      pr[0] = i + 1;
      ans++;
    }
  }
  l[0] = (l[0] - 1) % n + 1;
  l[1] = (l[1] - 1) % n + 1;
  r[0] = (r[0] - 1) % n + 1;
  r[1] = (r[1] - 1) % n + 1;
  if (ans + q[1] > q[0]) {
    printf("%d\n", ans + q[1]);
    printf("%d %d\n", l[1], r[1]);
    return 0;
  }
  if (ans + q[1] <= q[0]) {
    printf("%d\n", q[0]);
    printf("%d %d\n", l[0], r[0]);
    return 0;
  }
}
