#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
char buf[N], b[N];
int n, p[N], lvl[N], cnt[N], stk[N], nk[N], top = 1;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> buf;
  int s = 0, xi = 0;
  for (int i = 0, j = 0; j < n; ++j) {
    if (buf[j] == '(') {
      ++xi;
      ++i;
    } else if (i)
      --i;
    else
      s = j + 1;
  }
  if (xi + xi != n) {
    printf("0\n1 1\n");
    return 0;
  }
  memcpy(b, buf + s, n - s);
  memcpy(b + n - s, buf, s);
  for (int i = 0; i < n; ++i) {
    if (b[i] == '(') {
      nk[top] = 0;
      stk[top++] = i;
    } else {
      int ni = stk[--top];
      p[ni] = i;
      lvl[ni] = top;
      cnt[ni] = nk[top];
      ++nk[top - 1];
    }
  }
  int m = nk[0], a = -1;
  for (int i = 0; i < n; ++i) {
    if (b[i] != '(') continue;
    if (lvl[i] == 1) {
      if (cnt[i] + 1 > m) {
        m = cnt[i] + 1;
        a = i;
      }
    } else if (lvl[i] == 2) {
      if (cnt[i] + nk[0] + 1 > m) {
        m = cnt[i] + nk[0] + 1;
        a = i;
      }
    }
  }
  if (a < 0)
    printf("%d\n1 1\n", m);
  else {
    int a1 = a + s + 1;
    if (a1 > n) a1 -= n;
    int a2 = p[a] + s + 1;
    if (a2 > n) a2 -= n;
    printf("%d\n%d %d\n", m, a1, a2);
  }
  return 0;
}
