#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
int n, res, resi, resj, head;
int a[N];
char s[N];
int main() {
  scanf("%d%s", &n, s);
  a[0] = (s[0] == '(' ? 1 : -1);
  for (int i = 1; i < n; ++i) {
    a[i] = a[i - 1] + (s[i] == '(' ? 1 : -1);
    if (a[i] < a[head]) head = i;
  }
  if (a[n - 1] != 0) return printf("0\n1 1\n") & 0;
  for (int i = 0, add = -a[head]; i < n; ++i) a[i] += add;
  head = (head + 1) % n;
  int cnt0 = 0;
  for (int i = 0, cnt = 0, last; i < n; ++i) {
    if (a[(head + i) % n] == 0) {
      if (cnt > res) {
        res = cnt;
        resi = last;
        resj = (head + i) % n;
      }
      last = (head + i + 1) % n;
      cnt = 0;
      ++cnt0;
    } else if (a[(head + i) % n] == 1) {
      if (++cnt == 1) last = (head + i) % n;
    }
  }
  if (cnt0 > res) {
    res = cnt0;
    resi = resj = 0;
  }
  for (int i = 0, cnt = 0, last; i < n; ++i) {
    if (a[(head + i) % n] == 1) {
      if (cnt + cnt0 > res) {
        res = cnt + cnt0;
        resi = last;
        resj = (head + i) % n;
      }
      cnt = 0;
    } else if (a[(head + i) % n] == 2) {
      if (++cnt == 1) last = (head + i) % n;
    }
  }
  printf("%d\n%d %d\n", res, resi + 1, resj + 1);
  return 0;
}
