#include <bits/stdc++.h>
using namespace std;
const int maxnn = 3e5 + 7;
char s[maxnn];
char t[maxnn];
int a[maxnn];
int c[maxnn];
int pre[maxnn];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s + 1);
  int minn = 1e7 + 7;
  int xb = -1;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1] - 1;
    if (a[i] < minn) {
      minn = a[i];
      xb = i;
    }
  }
  if (a[n] != 0) {
    printf("%d\n%d %d\n", 0, 1, 1);
    return 0;
  }
  int cnt = 0, tot = 0;
  for (int i = xb + 1; i <= n; i++) t[++cnt] = s[i];
  for (int i = 1; i <= xb; i++) t[++cnt] = s[i];
  for (int i = 1; i <= n; i++) {
    if (t[i] == '(')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1] - 1;
    if (a[i] == 0) tot++;
  }
  int ans = tot;
  int x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= 2) {
      pre[i] = pre[i - 1];
      if (a[i] == 2)
        c[i] = c[i - 1] + 1;
      else
        c[i] = c[i - 1];
    } else
      pre[i] = i;
    if (i >= 2 && t[i] == ')' && pre[i - 1] != i - 1) {
      if (c[i - 1] + tot > ans) {
        ans = c[i - 1] + tot;
        x = i;
        y = pre[i - 1] + 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] >= 1) {
      pre[i] = pre[i - 1];
      if (a[i] == 1)
        c[i] = c[i - 1] + 1;
      else
        c[i] = c[i - 1];
    } else {
      pre[i] = i;
      c[i] = 0;
    }
    if (i >= 2 && t[i] == ')' && pre[i - 1] != i - 1) {
      if (c[i - 1] > ans) {
        ans = c[i - 1];
        x = i;
        y = pre[i - 1] + 1;
      }
    }
  }
  if (x <= n - xb)
    x += xb;
  else
    x -= (n - xb);
  if (y <= n - xb)
    y += xb;
  else
    y -= (n - xb);
  printf("%d\n%d %d\n", ans, x, y);
  return 0;
}
