#include <bits/stdc++.h>
using namespace std;
char s[600005];
int gg2 = -1, l = 1, r = 1, n;
int wtf(int x, int y) {
  int ans = 0, now = 0;
  for (int i = x; i <= y; i++) {
    if (s[i] == '(')
      now++;
    else
      now--;
    if (now == 0) ans++;
  }
  return ans;
}
void go(int x, int y) {
  int now = 0, tp = x, ans;
  for (int i = x; i <= y; i++) {
    if (s[i] == '(')
      now++;
    else
      now--;
    if (now == 0) {
      ans = wtf(tp + 1, i - 1);
      if (ans > gg2) {
        gg2 = ans;
        l = tp;
        r = i;
      }
      tp = i + 1;
    }
  }
}
int ok(int x) {
  if (x > n)
    return x - n;
  else
    return x;
}
int main() {
  int x = 0, y = -1, z, gg1 = 0, gg3;
  int maxx = 0, tl, tr, tans;
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(') x++;
    s[i + n] = s[i];
  }
  if (x * 2 == n) {
    x = 0;
    for (int i = n; i >= 1; i--) {
      if (s[i] == ')')
        x--;
      else
        x++;
      if (x > y) {
        y = x;
        z = i;
      }
    }
    x = 0;
    gg3 = z;
    for (int i = z; i < z + n; i++) {
      if (s[i] == '(')
        x++;
      else
        x--;
      if (x == 0) {
        gg1++;
        go(gg3 + 1, i - 1);
        tans = wtf(gg3 + 1, i - 1);
        if (tans > maxx) {
          maxx = tans;
          tl = gg3;
          tr = i;
        }
        gg3 = i + 1;
      }
    }
    if (maxx + 1 > gg1 + gg2)
      printf("%d\n%d %d\n", maxx + 1, ok(tl), ok(tr));
    else
      printf("%d\n%d %d\n", gg1 + 1 + gg2, ok(l), ok(r));
  } else
    printf("0\n1 1\n");
  return 0;
}
