#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 7;
struct ANS {
  int num, l, r;
} ans;
int n, pos, tmp;
string s;
int pre[maxn];
vector<int> v;
int main() {
  cin >> n >> s;
  int now = 0;
  pos = 0;
  ans.num = 0, ans.l = ans.r = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(')
      now++;
    else
      now--;
    if (now < tmp) tmp = now, pos = i + 1;
  }
  if (now != 0) {
    printf("0\n1 1\n");
    return 0;
  }
  v.push_back(0);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + (s[(pos + i - 1 + n) % n] == '(' ? 1 : -1);
    if (!pre[i]) v.push_back(i);
  }
  int len = v.size();
  ans.num = len - 1;
  for (int i = 0; i < len - 1; i++) {
    int Ml, Mr, Mm = -1;
    int l = -1, r = -1, num = 0;
    int sum = 0;
    for (int j = v[i] + 1; j <= v[i + 1]; j++) {
      if (pre[j] == 1) {
        sum++;
        if (l == -1)
          l = j + 1;
        else {
          if (num > Mm) {
            Ml = l, Mr = j, Mm = num;
          }
          l = j + 1;
          num = 0;
          r = -1;
        }
      } else if (pre[j] == 2) {
        num++;
      }
    }
    if (Mm + len - 1 > ans.num) {
      ans.num = Mm + len - 1;
      ans.l = Ml;
      ans.r = Mr;
    }
    if (sum > ans.num) {
      ans.num = sum;
      ans.l = v[i] + 1;
      ans.r = v[i + 1];
    }
  }
  printf("%d\n%d %d\n", ans.num, (ans.l + pos - 1) % n + 1,
         (ans.r + pos - 1) % n + 1);
  return 0;
}
