#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int cntans;
char s[N + 10];
struct Ans {
  int l, r, cnt;
} ans[N + 10];
struct Cmp {
  bool operator()(const Ans &x, const Ans &y) const { return x.cnt < y.cnt; }
};
int main() {
  int n, st = 0;
  scanf("%d", &n);
  scanf("%s", s);
  int cntl = 0, cntr = 0, tmp = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '(')
      ++cntl;
    else
      ++cntr;
    if (cntr - cntl > tmp) {
      st = i + 1;
      ++tmp;
    }
  }
  if (cntl != cntr) {
    printf("0\n1 1\n");
    return 0;
  }
  int l, r, cnt, tot;
  l = r = cnt = tot = tmp = 0;
  for (int i = 0; i < n; ++i) {
    int p = (i + st) % n;
    if (s[p] == '(') {
      if (!tmp) l = p + 1;
      ++tmp;
    } else {
      --tmp;
      if (tmp == 1) ++cnt;
      if (!tmp) {
        ans[++cntans] = {l, p + 1, ++cnt};
        l = cnt = 0;
        ++tot;
      }
    }
  }
  int lmt = cntans;
  l = r = cnt = tmp = 0;
  for (int i = 1; i <= lmt; ++i) {
    for (int j = ans[i].l; j <= ans[i].r + (ans[i].r < ans[i].l ? n : 0) - 2;
         ++j) {
      int p = j % n;
      if (s[p] == '(') {
        if (!tmp) l = p + 1;
        ++tmp;
      } else {
        --tmp;
        if (tmp == 1) ++cnt;
        if (!tmp) {
          ans[++cntans] = {l, p + 1, ++cnt + tot};
          l = cnt = 0;
        }
      }
    }
  }
  sort(ans + 1, ans + cntans + 1, Cmp());
  if (ans[cntans].cnt > tot) {
    tot = ans[cntans].cnt;
    l = ans[cntans].l;
    r = ans[cntans].r;
    printf("%d\n%d %d\n", tot, l, r);
  } else {
    printf("%d\n%d %d\n", tot, 1, 1);
  }
  return 0;
}
