#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 10;
const int INF = 0x3f3f3f3f;
int N;
char str[MAXN];
int n[MAXN];
int prefix[MAXN];
void quit() {
  printf("0\n1 1");
  exit(0);
}
struct node {
  int l, r, ans;
  node(int _l, int _r, int _ans) : l(_l), r(_r), ans(_ans) {}
  bool friend operator<(const node &a, const node &b) {
    if (a.ans != b.ans) return a.ans > b.ans;
    if (a.l == a.r) return 1;
    return 0;
  }
};
int main() {
  cin >> N >> str + 1;
  for (int i = 1; i <= N; ++i) n[i] = (str[i] == '(' ? 1 : -1);
  for (int i = 1; i <= N; ++i) prefix[i] = prefix[i - 1] + n[i];
  if (prefix[N] != 0) quit();
  int st = 0, min = INF;
  for (int i = 1; i <= N; ++i)
    if (prefix[i] < min) min = prefix[i], st = i;
  int tot = 0;
  for (int i = st + 1; i <= N; ++i) n[++tot] = (str[i] == '(' ? 1 : -1);
  for (int i = 1; i <= st; ++i) n[++tot] = (str[i] == '(' ? 1 : -1);
  for (int i = 1; i <= N; ++i) prefix[i] = prefix[i - 1] + n[i];
  int num0 = 0;
  for (int i = 1; i <= N; ++i)
    if (prefix[i] == 0) ++num0;
  int num2 = 0, num1 = 0;
  int l2 = 0, l1 = 0;
  vector<node> ans;
  ans.push_back(node(1, 1, num0));
  for (int i = 1; i <= N; ++i) {
    if (prefix[i] == 2) {
      ++num2;
      if (!l2) l2 = i;
    }
    if (prefix[i] == 1) {
      ++num1;
      if (!l1) l1 = i;
    }
    if (prefix[i] < 2) {
      ans.push_back(node(l2, i, num2 + num0));
      num2 = l2 = 0;
    }
    if (prefix[i] < 1) {
      ans.push_back(node(l1, i, num1));
      num1 = l1 = 0;
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans[0].ans << endl;
  int ans_l = (ans[0].l + st) % N;
  if (ans_l == 0) ans_l = N;
  int ans_r = (ans[0].r + st) % N;
  if (ans_r == 0) ans_r = N;
  cout << ans_l << ' ' << ans_r;
  return 0;
}
