#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int n, ans, x, y, st;
char a[N], b[N];
int s[N], top;
int c[N], d[N];
bool mark[N];
int fa[N];
void solve(int p) {
  for (int i = p + 1; i < c[p]; i = c[i] + 1) {
    fa[i] = p;
    solve(i);
    d[p]++;
  }
}
int main() {
  cin >> n;
  scanf("%s", a + 1);
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == '(')
      cnt1++;
    else
      cnt2++;
  }
  if (cnt1 != cnt2) return cout << "0\n1 1", 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == '(')
      top++;
    else if (top)
      top--;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == '(')
      top++;
    else {
      top--;
      if (top == 0) {
        st = i;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i <= st)
      b[i + n - st] = a[i];
    else
      b[i - st] = a[i];
  }
  top = 0;
  for (int i = 1; i <= n; i++) {
    if (b[i] == '(')
      s[++top] = i;
    else {
      c[s[top]] = i;
      top--;
    }
  }
  int res = 0;
  for (int i = 1; i <= n; i = c[i] + 1) {
    solve(i);
    res++;
  }
  ans = res, x = 1, y = 1;
  for (int i = 1; i <= n; i++) {
    if (b[i] == ')') continue;
    if (!fa[i]) {
      int o = d[i] + 1;
      if (o > ans) ans = o, x = i, y = c[i];
    } else {
      if (fa[fa[i]] == 0) {
        int o = res + d[i] + 1;
        if (o > ans) ans = o, x = i, y = c[i];
      }
    }
  }
  x += st, y += st;
  if (x > n) x -= n;
  if (y > n) y -= n;
  cout << ans << endl << x << ' ' << y;
  return 0;
}
