#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long qpow(long long a, long long b, long long m) {
  long long r = 1;
  a %= m;
  for (; b; b >>= 1) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
  }
  return r;
}
const int inf = 0x7fffffff;
const int maxn = 3e5 + 10;
char a[maxn], b[maxn];
vector<int> pos, p2;
int c[maxn];
int n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> (a + 1);
  for (int i = 1; i <= n; i++) c[i] = c[i - 1] + ((a[i] == '(') ? 1 : -1);
  if (c[n]) {
    cout << 0 << endl << "1 1" << endl;
    return 0;
  }
  int mi = inf, t = 0, pp = 0;
  for (int i = 1; i <= n; i++) mi = min(mi, c[i]);
  if (mi != 0) {
    for (int i = 1; i <= n; i++)
      if (c[i] == mi) pos.push_back(i);
    for (int i = pos[0] + 1; i <= n; i++) b[++t] = a[i];
    for (int i = 1; i <= pos[0]; i++) b[++t] = a[i];
    pp = pos[0];
  } else {
    for (int i = 1; i <= n; i++) b[i] = a[i];
    pp = 0;
  }
  for (int i = 1; i <= n; i++) c[i] = c[i - 1] + ((b[i] == '(') ? 1 : -1);
  pos.clear();
  pos.push_back(0);
  for (int i = 1; i <= n; i++)
    if (!c[i]) pos.push_back(i);
  int mx = (int)(pos).size() - 1;
  pair<int, int> ans = pair<int, int>(1, 1);
  int lst = -1, ccnt = 0;
  for (int i = 1; i <= n; i++) {
    if (c[i] == 0 || c[i] == 1) {
      lst = -1;
      ccnt = 0;
      continue;
    }
    if (c[i] == 2) {
      ccnt++;
      if (lst == -1)
        lst = i;
      else {
        int l = (lst + pp) % n;
        int r = (i + 1 + pp) % n;
        if (l == 0) l = n;
        if (r == 0) r = n;
        if (mx < (int)(pos).size() - 1 + ccnt) {
          mx = (int)(pos).size() - 1 + ccnt;
          ans = pair<int, int>(l, r);
        }
      }
      int l = (i + pp) % n;
      int r = (i + 1 + pp) % n;
      if (l == 0) l = n;
      if (r == 0) r = n;
      if (mx < (int)(pos).size()) {
        mx = (int)(pos).size();
        ans = pair<int, int>(l, r);
      }
    }
  }
  for (int i = 1; i < (int)(pos).size(); i++) {
    int cnt = 0;
    for (int j = pos[i - 1] + 1; j <= pos[i]; j++)
      if (c[j] == 1) cnt++;
    if (cnt > mx) {
      mx = cnt;
      int l = (pos[i - 1] + 1 + pp) % n;
      if (l == 0) l = n;
      int r = (pos[i] + pp) % n;
      if (r == 0) r = n;
      ans = pair<int, int>(l, r);
    }
  }
  cout << mx << endl;
  cout << ans.first << " " << ans.second << endl;
  return 0;
}
