#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
char s[N * 2];
int mx, mxl, mxr, ori;
int f2(int n, int& p) {
  int l = 0, cnt = 0;
  while (1) {
    if (p > n || (l == 0 && s[p] == ')')) break;
    if (s[p] == '(')
      ++l;
    else if (--l == 0)
      ++cnt;
    ++p;
  }
  return cnt;
}
int f1(int n, int& p) {
  int ret = 0, j;
  while (s[p] != ')') {
    j = p, ++ret, ++p;
    int cnt = f2(n, p);
    if (cnt + 1 + ori > mx) mx = cnt + 1 + ori, mxl = j, mxr = p;
    ++p;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, i, lc = 0, rc = 0, j;
  cin >> n;
  cin >> (s + 1);
  for (i = 1; i <= n; ++i) {
    if (s[i] == '(')
      ++lc;
    else
      ++rc;
    s[n + i] = s[i];
  }
  if (lc != rc) {
    printf("0\n1 1\n");
    return 0;
  }
  int l = 0, r = 0;
  for (i = 1; i <= n; ++i) {
    if (s[i] == '(')
      ++l;
    else {
      if (l)
        --l;
      else
        ++r;
    }
  }
  int offset = 0;
  while (l || r) {
    ++offset;
    if (s[offset] == '(')
      ++r, ++l;
    else
      --l, --r;
  }
  for (i = 1; i <= n; ++i) s[i] = s[offset + i];
  mx = ori = f2(n, i = 1), mxl = mxr = 1;
  i = 1;
  while (i <= n) {
    j = i, ++i;
    int cnt = f1(n, i);
    if (cnt + 1 > mx) mx = cnt + 1, mxl = j, mxr = i;
    ++i;
  }
  mxl = offset + mxl > n ? offset + mxl - n : offset + mxl;
  mxr = offset + mxr > n ? offset + mxr - n : offset + mxr;
  cout << mx << endl << mxl << " " << mxr << endl;
  return 0;
}
