#include <bits/stdc++.h>
using namespace std;
char br[600300];
int ibr[600300];
int sibr[600300];
int n;
int main() {
  int i, j, m, mc1, mc2, mc3, c2, c3, cnt, st, ed, ans;
  scanf("%d %s", &n, &br);
  for (i = 0; i < n; i++) ibr[i] = ibr[n + i] = ((br[i] == '(') ? 1 : -1);
  sibr[0] = ibr[0];
  m = sibr[0];
  for (i = 1; i < 2 * n; i++)
    sibr[i] = sibr[i - 1] + ibr[i], m = (((m) < (sibr[i])) ? (m) : (sibr[i]));
  if (sibr[n - 1] != 0) {
    printf("%d\n%d %d\n", 0, 1, 1);
    return 0;
  }
  mc1 = mc2 = mc3 = 0;
  c2 = c3 = 0;
  for (i = 0; i < n; i++)
    if (sibr[i] == m) mc1++;
  for (i = 0; i < 2 * n - 1; i++) {
    if (sibr[i] == m + 1)
      c2++;
    else if (sibr[i] < m + 1) {
      mc2 = (((mc2) > (c2)) ? (mc2) : (c2));
      c2 = 0;
    }
    if (sibr[i] == m + 2)
      c3++;
    else if (sibr[i] < m + 2) {
      mc3 = (((mc3) > (c3)) ? (mc3) : (c3));
      c3 = 0;
    }
  }
  if (mc1 + mc3 >= mc2) {
    st = ed = cnt = 0;
    if (mc3 > 0) {
      for (i = 0; i < 2 * n - 1; i++) {
        if (sibr[i] == m + 2) {
          if (cnt == 0) st = i;
          cnt++;
        } else if (sibr[i] < m + 2)
          cnt = 0;
        if (cnt == mc3) {
          ed = i + 1;
          break;
        }
      }
    }
    printf("%d\n%d %d\n", mc1 + mc3, (st % n) + 1, (ed % n) + 1);
    return 0;
  } else {
    st = ed = cnt = 0;
    for (i = 0; i < 2 * n - 1; i++) {
      if (sibr[i] == m + 1) {
        if (cnt == 0) st = i;
        cnt++;
      } else if (sibr[i] < m + 1)
        cnt = 0;
      if (cnt == mc2) {
        ed = i + 1;
        break;
      }
    }
    printf("%d\n%d %d\n", mc2, (st % n) + 1, (ed % n) + 1);
    return 0;
  }
}
