#include <bits/stdc++.h>
const int maxn = 3e5 + 10;
int n;
char s[maxn];
int a[maxn], b[maxn] = {0}, tmp[maxn];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  int min = 0x7fffffff, pos;
  int ansx, ansy, cnt = 0;
  for (int i = 1; i <= n; i++) {
    a[i] = s[i] == '(' ? 1 : -1;
    b[i] = b[i - 1] + a[i];
    if (b[i] < min) {
      min = b[i];
      pos = i;
    }
  }
  if (b[n] != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) tmp[i] = a[(pos + i - 1) % n + 1];
  std::vector<int> v;
  v.push_back(0);
  for (int i = 1; i <= n; i++) {
    a[i] = tmp[i];
    b[i] = b[i - 1] + a[i];
    if (!b[i]) {
      v.push_back(i);
      cnt++;
    }
  }
  int ans = cnt;
  int size = v.size();
  for (int i = 1; i < size; i++) {
    int l = v[i - 1] + 1, r = v[i], t = 0;
    for (int j = l; j < r; j++) {
      if (b[j] == 1) t++;
    }
    if (t > ans) {
      ans = t;
      ansx = l;
      ansy = r;
    }
  }
  v.clear();
  for (int i = 1; i <= n; i++) {
    if (b[i] == 1) v.push_back(i);
  }
  size = v.size();
  for (int i = 1; i < size; i++) {
    int l = v[i - 1] + 1, r = v[i], t = cnt;
    if (b[l] == 0) continue;
    for (int j = l; j < r; j++) {
      if (b[j] == 2) t++;
    }
    if (t > ans) {
      ans = t;
      ansx = l;
      ansy = r;
    }
  }
  printf("%d\n%d %d\n", ans, (ansx + pos - 1) % n + 1,
         (ansy + pos - 1) % n + 1);
}
