#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int maxn = 3e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n, l[maxn], r[maxn], fa[maxn], cnt[maxn], sta[maxn], tot, top;
char s[maxn << 1];
int main() {
  scanf("%d%s", &n, s + 1);
  int id = 0, mn = 0, now = 0;
  for (int i = 1; i <= n; i++) {
    now += (s[i] == '(') ? 1 : -1;
    if (now < mn) mn = now, id = i;
  }
  if (now != 0) return printf("0\n1 1\n"), 0;
  for (int i = n + 1; i <= 2 * n; i++) s[i] = s[i - n];
  for (int i = id + 1; i <= id + n; i++)
    if (s[i] == '(')
      sta[++top] = ++tot, l[tot] = i;
    else
      r[sta[top]] = i, fa[sta[top]] = sta[top - 1], cnt[sta[--top]]++;
  int ans = cnt[0], _l = 1, _r = 1;
  for (int i = 1; i <= tot; i++)
    if (!fa[i] && cnt[i] + 1 > ans)
      ans = cnt[i] + 1, _l = l[i], _r = r[i];
    else if (fa[i] && !fa[fa[i]] && cnt[0] + cnt[i] + 1 > ans)
      ans = cnt[0] + cnt[i] + 1, _l = l[i], _r = r[i];
  printf("%d\n%d %d\n", ans, (_l - 1) % n + 1, (_r - 1) % n + 1);
}
