#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long llinf = (1LL << 62);
const int inf = (1 << 30);
const int nmax = 3e5 + 50;
const int mod = 1e9 + 7;
using namespace std;
int n, ic, io, i, nr, rs, f[nmax], l[nmax], r[nmax], p[nmax], tot, mn = inf;
char c[nmax], b[nmax];
stack<int> st;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) cin >> c[i];
  for (i = 1; i <= n; i++) {
    if (c[i] == '(')
      nr++;
    else
      nr--;
  }
  if (nr) {
    cout << 0 << endl << 1 << " " << 1 << endl;
    return 0;
  }
  nr = 0;
  for (i = 1; i <= n; i++) {
    if (c[i] == '(')
      nr++;
    else
      nr--;
    if (nr < mn && nr < 0) {
      mn = nr;
      ic = i;
    }
  }
  nr = 0;
  for (i = 1; i <= n; i++) p[i] = i;
  if (ic) {
    for (i = ic + 1; i <= n; i++) b[i - ic] = c[i], p[i - ic] = i;
    for (i = 1; i <= ic; i++) b[n - ic + i] = c[i], p[n - ic + i] = i;
    for (i = 1; i <= n; i++) c[i] = b[i];
  }
  ic = io = 1;
  for (i = 1; i <= n; i++) {
    if (c[i] == '(')
      st.push(i);
    else
      l[i] = st.top(), st.pop(), r[l[i]] = i;
  }
  for (i = n; i >= 1; i--) {
    if (c[i] == ')') {
      if (!st.empty()) f[st.top()]++;
      st.push(i);
    }
    if (r[i] == st.top()) st.pop();
  }
  nr = 0;
  for (i = 1; i <= n; i++) {
    if (c[i] == '(')
      nr++;
    else
      nr--;
    if (!nr) tot++;
  }
  nr = 0;
  for (i = n; i >= 1; i--) {
    if (c[i] == '(')
      nr++;
    else
      nr--;
    if (c[i] == ')') {
      if (nr == -2) {
        if (rs < f[i] + 1) {
          rs = f[i] + 1;
          io = l[i];
          ic = i;
        }
      } else if (nr == -1) {
        if (rs < f[i] + 1 - tot) {
          rs = f[i] + 1 - tot;
          io = l[i];
          ic = i;
        }
      }
    }
  }
  cout << tot + rs << endl << p[io] << " " << p[ic] << endl;
  return 0;
}
