#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
char a[N], b[N];
int pre[N];
vector<int> Q;
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", a + 1);
  int c = 0, now = 0, mi = 0, pos = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == '(')
      now++;
    else if (a[i] == ')')
      now--;
    if (now < mi) mi = now, pos = i;
  }
  if (now) {
    printf("0\n1 1\n");
    return 0;
  }
  Q.push_back(0);
  for (int i = 1; i <= n; i++) {
    b[i] = a[(i + pos - 1) % n + 1];
    pre[i] = pre[i - 1] + (b[i] == '(' ? 1 : -1);
    if (pre[i] == 0) {
      Q.push_back(i);
      c++;
    }
  }
  int ans = c, L = 1, R = 1;
  for (int i = 1; i < Q.size(); i++) {
    int l = Q[i - 1] + 1, r = Q[i], tmp = 0;
    for (int j = l; j <= r; j++) {
      if (pre[j] == 1) {
        tmp++;
      }
    }
    if (tmp > ans) {
      ans = tmp;
      L = l, R = r;
    }
  }
  Q.clear();
  for (int i = 1; i <= n; i++) {
    if (pre[i] == 1) Q.push_back(i);
  }
  for (int i = 1; i < Q.size(); i++) {
    int l = Q[i - 1] + 1, r = Q[i], tmp = c;
    if (pre[l] == 0) continue;
    for (int j = l; j <= r; j++) {
      if (pre[j] == 2) tmp++;
    }
    if (tmp > ans) {
      ans = tmp;
      L = l, R = r;
    }
  }
  printf("%d\n", ans);
  printf("%d %d\n", (L + pos - 1) % n + 1, (R + pos - 1) % n + 1);
}
