#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, pre[N][3], sum[N], l = 1, r = 1, ans;
char s[N], ss[N];
void upd(int L, int R, int v) {
  if (v > ans) ans = v, l = L, r = R;
}
void work(int L, int R) {
  int lst = L;
  for (int i = L + 1; i <= R; i++)
    if (sum[i] == 1) {
      upd(lst + 1, i, pre[n][0] + pre[i][2] - pre[lst][2]);
      lst = i;
    }
}
int main() {
  n = gi();
  scanf("%s", s + 1);
  int mn = 0, p = 0;
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + (s[i] == '(' ? 1 : -1);
    if (sum[i] < mn) mn = sum[i], p = i;
  }
  if (sum[n] != 0) return cout << "0\n1 1", 0;
  int nn = 0;
  for (int i = p + 1; i <= n; i++) ss[++nn] = s[i];
  for (int i = 1; i <= p; i++) ss[++nn] = s[i];
  for (int i = 1; i <= n; i++) s[i] = ss[i];
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + (s[i] == '(' ? 1 : -1);
    for (int j = 0; j < 3; j++) pre[i][j] = pre[i - 1][j];
    if (sum[i] < 3) ++pre[i][sum[i]];
  }
  ans = pre[n][0];
  int lst = 0;
  for (int i = 1; i <= n; i++) {
    if (sum[i] == 0) {
      upd(lst + 1, i, pre[i][1] - pre[lst][1]);
      work(lst + 1, i - 1);
      lst = i;
    }
  }
  l += p, r += p;
  if (l > n) l -= n;
  if (r > n) r -= n;
  cout << ans << '\n' << l << ' ' << r;
  return 0;
}
