#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1);
const int M = 3e5 + 10;
const int inf = 2e9 + 10;
const int mod = 1e9 + 7;
int n, stk[M], le[M], ri[M], f[M], cnt[M];
char s[M], s1[M];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> s + 1;
  int num = 0, min = 0, id = 0;
  for (int i = 1; i <= n; ++i) {
    if (s[i] == '(')
      ++num;
    else
      --num;
    if (num < min) {
      min = num;
      id = i;
    }
  }
  if (num) {
    cout << "0\n1 1\n";
    return 0;
  }
  for (int i = 1; i <= id; ++i) s1[n + i - id] = s[i];
  for (int i = id + 1; i <= n; ++i) s1[i - id] = s[i];
  int top = 0;
  num = 0;
  for (int i = 1; i <= n; ++i) {
    if (s1[i] == '(') {
      stk[++top] = ++num;
      le[num] = i;
    } else {
      int t1 = stk[top];
      ri[t1] = i;
      f[t1] = stk[--top];
      ++cnt[stk[top]];
    }
  }
  int ans = cnt[0], lans = 1, rans = 1;
  for (int i = 1; i <= num; ++i) {
    if (cnt[i] + 1 > ans && !f[i]) {
      ans = cnt[i] + 1;
      lans = le[i];
      rans = ri[i];
    }
    if (cnt[i] + 1 + cnt[0] > ans && f[i] && !f[f[i]]) {
      ans = cnt[i] + 1 + cnt[0];
      lans = le[i];
      rans = ri[i];
    }
  }
  lans = (lans + id - 1) % n + 1;
  rans = (rans + id - 1) % n + 1;
  cout << ans << '\n' << lans << ' ' << rans << '\n';
}
