#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long MAXN = 3e6 + 7;
const long long MAXM = 1e6 + 7;
const long long MOD = 1e9 + 7;
const double eps = 1e-6;
const double pi = acos(-1.0);
char str[MAXN];
int sum[MAXN];
int s1[MAXN], s2[MAXN], s3[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  scanf(" %s", str + 1);
  int pos = 1;
  int cnt = 0;
  int minn = 0;
  for (int i = 1; i <= n; i++) {
    if (str[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < minn) {
      minn = cnt;
      pos = i + 1;
    }
  }
  if (cnt)
    printf("0\n1 1\n");
  else {
    stack<int> sta;
    for (int i = n + 1; i <= 2 * n; i++) str[i] = str[i - n];
    for (int i = pos; i < pos + n; i++) {
      s1[i] = s1[i - 1];
      s2[i] = s2[i - 1];
      s3[i] = s3[i - 1];
      if (str[i] == '(')
        sta.push(i);
      else {
        sta.pop();
        if (sta.empty())
          s1[i]++;
        else if (sta.size() == 1)
          s2[i]++;
        else if (sta.size() == 2)
          s3[i]++;
      }
    }
    int ans = s1[pos + n - 1], l = 1, r = 1;
    for (int i = pos; i < pos + n; i++) {
      if (str[i] == '(')
        sta.push(i);
      else {
        int temp = sta.top();
        sta.pop();
        if (sta.empty()) {
          int tt = s2[i] - s2[temp] + 1;
          if (tt > ans) {
            ans = tt;
            if (i % n)
              r = i % n;
            else
              r = n;
            if (temp % n)
              l = temp % n;
            else
              l = temp;
          }
        } else if (sta.size() == 1) {
          int tt = s3[i] - s3[temp] + s1[pos + n - 1] + 1;
          if (tt > ans) {
            ans = tt;
            if (i % n)
              r = i % n;
            else
              r = n;
            if (temp % n)
              l = temp % n;
            else
              l = temp;
          }
        }
      }
    }
    printf("%d\n%d %d\n", ans, l, r);
  }
  return 0;
}
