#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * w;
}
typedef int arr[300005];
int n, sL = 1, sR = 1, Mid, Min, Num, Top, Ans;
arr L, R, fa, stk, Cnt;
char c[300005], s[300005];
int main() {
  cin >> n;
  scanf("%s", c + 1);
  for (int i = (1); i <= (n); i++) {
    c[i] == '(' ? ++Top : --Top;
    if (Top < Min) Min = Top, Mid = i;
  }
  if (Top) return cout << "0\n1 1", 0;
  for (int i = (Mid + 1); i <= (n); i++) s[i - Mid] = c[i];
  for (int i = (1); i <= (Mid - 1); i++) s[i + n - Mid] = c[i];
  for (int i = (1); i <= (n); i++)
    if (s[i] == '(')
      stk[++Top] = ++Num, L[Num] = i;
    else
      R[stk[Top]] = i, fa[stk[Top]] = stk[Top - 1], ++Cnt[stk[--Top]];
  Ans = Cnt[0];
  for (int i = (1); i <= (Num); i++)
    if (Cnt[i] + 1 > Ans && !fa[i])
      Ans = Cnt[i] + 1, sL = L[i], sR = R[i];
    else if (Cnt[0] + Cnt[i] + 1 > Ans && fa[i] && !fa[fa[i]])
      Ans = Cnt[0] + Cnt[i] + 1, sL = L[i], sR = R[i];
  (sL += Mid) > n ? sL -= n : 0, (sR += Mid) > n ? sR -= n : 0;
  cout << Ans << endl << sL << " " << sR;
  return 0;
}
