#include <bits/stdc++.h>
using namespace std;
mt19937 mt_rand(time(0));
const int N = 3e5 + 5;
int n, sum[2 * N];
char s[2 * N];
int solve(int p, int k) {
  int ans = 0;
  int cnt0 = 0;
  int cn1 = 1;
  int cn2 = 0;
  int ans2 = 0;
  int ans1 = 0;
  int p2 = p, k2 = p;
  int p1 = p, k1 = p;
  int p2tmp = 0;
  int p1tmp = p;
  sum[p] = 1;
  for (int i = p + 1; i < k; i++) {
    sum[i] = sum[i - 1];
    if (s[i] == '(')
      sum[i]++;
    else
      sum[i]--;
    if (sum[i] == 0) {
      cnt0++;
      if (cn1 > ans1) {
        ans1 = cn1;
        p1 = p1tmp;
        k1 = i;
      }
      cn1 = 0;
      p1tmp = 0;
    }
    if (sum[i] == 1) {
      if (p1tmp == 0) p1tmp = i;
      cn1++;
      if (cn2 > ans2) {
        ans2 = cn2;
        k2 = i;
        p2 = p2tmp;
      }
      p2tmp = 0;
      cn2 = 0;
    }
    if (sum[i] == 2) {
      cn2++;
      if (p2tmp == 0) p2tmp = i;
    }
  }
  p1 %= n;
  p2 %= n;
  k1 %= n;
  k2 %= n;
  p1++;
  p2++;
  k1++;
  k2++;
  ans = max(ans2 + cnt0, ans1);
  printf("%d\n", ans);
  if (ans == ans1) {
    printf("%d %d\n", p1, k1);
    return 0;
  }
  printf("%d %d\n", p2, k2);
}
int main() {
  scanf("%d%s", &n, s);
  for (int i = n; i < 2 * n; i++) s[i] = s[i - n];
  if (s[0] == '(')
    sum[0] = 1;
  else
    sum[0] = -1;
  for (int i = 1; i < 2 * n; i++) {
    sum[i] = sum[i - 1];
    if (s[i] == '(')
      sum[i]++;
    else
      sum[i]--;
  }
  if (sum[n - 1] != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  int minpos = 0;
  for (int i = 1; i < 2 * n; i++)
    if (sum[minpos] > sum[i]) minpos = i;
  solve(minpos + 1, minpos + 1 + n);
  return 0;
}
