#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
char s[N];
int f[N << 1], n;
int main() {
  scanf("%d%s", &n, s + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      f[i] = f[i + n] = 1;
    else
      f[i] = f[i + n] = -1;
  }
  for (int i = 1; i <= n << 1; i++) f[i] += f[i - 1];
  if (f[n])
    printf("0\n1 1\n");
  else {
    int pos = min_element(f + 1, f + n + 1) - f, mn = f[pos];
    for (int i = 1; i <= n << 1; i++) f[i] -= mn;
    int mx = 0, l = 1, r = 1, t = 0, tl = -1;
    for (int i = 1; i <= n; i++) {
      if (f[i + pos] == 1) {
        if (t > mx) mx = t, l = tl, r = i;
        tl = i + 1, t = 0;
      } else if (f[i + pos] == 2)
        t++;
    }
    for (int i = 1; i <= n; i++)
      if (f[i + pos] == 0) mx++;
    t = 0, tl = 0;
    for (int i = 1; i <= n; i++) {
      if (f[i + pos] == 0) {
        if (t > mx) mx = t, l = tl + 1, r = i;
        tl = i, t = 0;
      } else if (f[i + pos] == 1)
        t++;
    }
    printf("%d\n%d %d\n", mx, (l + pos - 1 + n) % n + 1,
           (r + pos - 1 + n) % n + 1);
  }
  return 0;
}
