#include <bits/stdc++.h>
using namespace std;
char S[600005];
int A[600005], n, m, cnt = 1;
int main() {
  scanf("%d%s", &n, S + 1);
  m = n;
  for (int i = 1; i <= n; i++) {
    if (S[i] == '(')
      A[i] = A[i - 1] + 1;
    else
      A[i] = A[i - 1] - 1;
    if (m > A[i])
      m = A[i], cnt = 1;
    else if (m == A[i])
      cnt++;
  }
  for (int i = 1; i <= n; i++) A[i + n] = A[i], S[i + n] = S[i];
  if (A[n]) {
    puts("0");
    puts("1 1");
    return 0;
  }
  int ans = cnt, l = 1, r = 1;
  for (int i = 1; i <= n + n; i++) {
    if (S[i] == '(') {
      int j = i, c1 = 0;
      while (j <= n + n && A[j] >= m + 1) {
        c1 += (A[j] == m + 1);
        if (j - i >= n) {
          do {
            c1 -= (A[i] == m + 1);
            i++;
          } while (S[i] == ')');
        }
        if (S[j + 1] == ')' && c1 > ans) {
          ans = c1;
          l = i, r = j + 1;
        }
        j++;
      }
      i = j;
    }
  }
  for (int i = 1; i <= 2 * n; i++) {
    if (S[i] == '(') {
      int j = i, c2 = 0;
      while (j <= n + n && A[j] >= m + 2) {
        c2 += (A[j] == m + 2);
        if (j - i >= n) {
          do {
            c2 -= (A[i] == m + 2);
            i++;
          } while (S[i] == ')');
        }
        if (S[j + 1] == ')' && cnt + c2 > ans) {
          ans = cnt + c2;
          l = i, r = j + 1;
        }
        j++;
      }
      i = j;
    }
  }
  if (r > n) r -= n;
  printf("%d\n%d %d", ans, l, r);
}
