#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int MAX_N = 3e5 + 5;
int n;
char s[MAX_N << 1];
int sum[MAX_N << 1];
int mn = inf, res = 0, ans = 0, l = 1, r = 1;
vector<int> pos;
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (register int i = 1; i <= n; i++) s[i + n] = s[i];
  sum[0] = 0;
  for (register int i = 1; i <= 2 * n; i++) {
    if (s[i] == '(')
      sum[i] = sum[i - 1] + 1;
    else
      sum[i] = sum[i - 1] - 1;
    mn = min(mn, sum[i]);
  }
  if (sum[n] != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  for (register int i = 1; i <= 2 * n; i++)
    if (sum[i] == mn) pos.push_back(i);
  ans = res = pos.size() / 2;
  for (register int i = 1; i <= 2 * n; i++) sum[i] -= mn;
  for (register int i = 1; i <= ans * 2 - 1; i++) {
    int cnt1 = 0, cnt2 = 0, mcnt2 = 0, t = pos[i - 1] + 1;
    for (register int j = pos[i - 1] + 1; j <= pos[i] - 1; j++) {
      if (sum[j] == 1) {
        cnt1++;
        if (cnt2 > mcnt2) {
          mcnt2 = cnt2;
          if (ans + mcnt2 > res) {
            res = ans + mcnt2;
            l = t, r = j;
          }
        }
        t = j + 1, cnt2 = 0;
      } else if (sum[j] == 2)
        cnt2++;
    }
    if (cnt1 > res) res = cnt1, l = pos[i - 1] + 1, r = pos[i];
  }
  if (l > n) l -= n;
  if (r > n) r -= n;
  if (l > r) swap(l, r);
  printf("%d\n%d %d\n", res, l, r);
  return 0;
}
