#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
const int N = 3e5 + 10, INF = 1e9;
int pre[2 * N];
pair<int, PII> get(int n, int x) {
  pair<int, PII> res{0, {0, 0}};
  int c = -INF, prev = -1;
  for (int i = 0; i < 2 * n; i++) {
    if (pre[i] == x) {
      res = max(res, {c, {prev + 1, i}});
      c = 0;
      prev = i;
    }
    if (pre[i] == x + 1) c++;
    if (pre[i] < x) c = -INF;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int lo = 0;
  for (int i = 0; i < n; i++) {
    pre[i] = s[i] == '(' ? 1 : -1;
    if (i > 0) pre[i] += pre[i - 1];
    lo = min(lo, pre[i]);
    pre[n + i] = pre[i];
  }
  pair<int, PII> ans{0, {0, 0}};
  if (pre[n - 1] == 0) {
    int flo = 0;
    for (int i = 0; i < n; i++) {
      if (pre[i] == lo) flo++;
    }
    ans = max(ans, get(n, lo));
    auto e = get(n, lo + 1);
    e.first += flo;
    ans = max(ans, e);
  }
  cout << ans.first << '\n';
  auto [l, r] = ans.second;
  cout << (l % n + 1) << ' ' << (r % n + 1) << '\n';
  return 0;
}
