#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 3e5 + 7;
int n, cnt, sl, sr, sum[N];
char s[N], tmp[N];
int main() {
  n = read();
  scanf("%s", s + 1);
  int pos = 0, now = 0, mi = 0;
  for (int i = 1; i <= n; i++) {
    now += s[i] == '(' ? 1 : -1;
    if (now < mi) mi = now, pos = i;
  }
  if (now != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) tmp[i] = s[(pos + i - 1) % n + 1];
  vector<int> V;
  V.push_back(0);
  for (int i = 1; i <= n; i++) {
    s[i] = tmp[i];
    sum[i] = sum[i - 1] + (s[i] == '(' ? 1 : -1);
    if (!sum[i]) cnt++, V.push_back(i);
  }
  int ans = cnt, L = 1, R = 1, len = V.size();
  for (int i = 1; i < len; i++) {
    int l = V[i - 1] + 1, r = V[i], t = 0;
    for (int j = l; j <= r; j++) t += sum[j] == 1;
    if (t > ans) ans = t, L = l, R = r;
  }
  V.clear();
  for (int i = 1; i <= n; i++)
    if (sum[i] == 1) V.push_back(i);
  len = V.size();
  for (int i = 1; i < len; i++) {
    int l = V[i - 1] + 1, r = V[i], t = cnt;
    if (sum[l] == 0) continue;
    for (int j = l; j <= r; j++) t += sum[j] == 2;
    if (t > ans) ans = t, L = l, R = r;
  }
  printf("%d\n%d %d\n", ans, (L + pos - 1) % n + 1, (R + pos - 1) % n + 1);
  return 0;
}
