#include <bits/stdc++.h>
using namespace std;
const int maxn = 300010;
int N, l = 0, r = 0, sum = 0, mk, st[maxn];
pair<int, int> anss(1, 1);
int ans = 0;
char s[maxn];
void search(int l, int r, int f) {
  if ((l + 1) % N == r) return;
  vector<pair<int, int> > ss;
  int Index = 0, cnt = -1, tmpcnt = 0;
  pair<int, int> tmpp;
  for (int i = l;; i = (i + 1) % N) {
    if (s[(i + mk) % N] == '(')
      st[++Index] = i;
    else if (s[(i + mk) % N] == ')') {
      int L = st[Index--], R = i;
      if (Index == 2 && !f) tmpcnt++;
      if (Index == 1) {
        if (f)
          tmpcnt++;
        else {
          ss.push_back(make_pair(L, R));
          if (cnt < tmpcnt) {
            cnt = tmpcnt;
            tmpp = make_pair(L, R);
          }
          tmpcnt = 0;
        }
      }
      if (Index == 0 && f) {
        if (cnt < tmpcnt) {
          cnt = tmpcnt;
          tmpp = make_pair(L, R);
        }
        tmpcnt = 0;
        ss.push_back(make_pair(L, R));
      }
    }
    if (i == r) break;
  }
  if (f) {
    if (ans < cnt + 1) {
      ans = cnt + 1;
      anss = tmpp;
    }
  } else {
    if (ans < sum - 1 + cnt + 2) {
      ans = sum - 1 + cnt + 2;
      anss = tmpp;
    }
  }
  if (f)
    for (int i = 0; i < ss.size(); i++) {
      pair<int, int> a = ss[i];
      search(a.first, a.second, 0);
    }
}
int main() {
  scanf("%d%s", &N, s);
  for (int i = 0; i < N; i++) {
    if (s[i] == '(')
      l++;
    else
      r++;
  }
  if (l != r) {
    printf("0\n1 1\n");
    return 0;
  }
  int Index = 0;
  for (int i = 0; i < N; i++) {
    bool ok = true;
    int Index = 0;
    for (int j = 0; j < N; j++) {
      if (s[(i + j) % N] == '(')
        Index++;
      else if (s[(i + j) % N] == ')' && Index)
        Index--;
      else {
        ok = false;
        break;
      }
    }
    if (ok) {
      mk = i;
      break;
    }
  }
  Index = 0;
  for (int i = 0; i < N; i++) {
    if (s[(i + mk) % N] == '(')
      Index++;
    else if (s[(i + mk) % N] == ')') {
      Index--;
      if (Index == 0) sum++;
    }
  }
  ans = sum;
  search(0, N - 1, 1);
  printf("%d\n", ans);
  printf("%d %d\n", (anss.first + mk) % N + 1, (anss.second + mk) % N + 1);
}
