#include <bits/stdc++.h>
using namespace std;
string s;
int n;
vector<int> ss;
int num(char x) { return x == '(' ? 1 : -1; }
void init() {
  cin >> n;
  cin >> s;
  ss.resize(n + 10);
  ss[0] = 0;
  for (int i = 0; i < n; i++) {
    ss[i + 1] = ss[i] + num(s[i]);
  }
}
void work() {
  if (ss[n] != 0) {
    cout << 0 << endl;
    cout << 1 << " " << 1 << endl;
    return;
  }
  int mi = 0, minPos = 0;
  for (int i = 1; i <= n; i++) {
    if (ss[i] < mi) {
      mi = ss[i];
      minPos = i;
    }
  }
  int zeroCt = 0;
  ss[0] = 0;
  for (int i = 1; i <= n; i++) {
    ss[i] = ss[i - 1] + num(s[(minPos - 1 + i) % n]);
    if (ss[i] == 0) zeroCt++;
  }
  int oneCt = 0, twoCt = 0;
  int oneStart = 0, twoStart = 0;
  int ans = zeroCt, ansL = 1, ansR = 1;
  for (int i = 0; i <= n; i++) {
    if (ss[i] == 1) {
      oneCt++;
    }
    if (ss[i] == 0) {
      if (oneCt > ans) {
        ans = oneCt;
        ansL = oneStart + 1;
        ansR = i;
      }
      oneStart = i;
      oneCt = 0;
    }
    if (ss[i] == 2) {
      twoCt++;
    }
    if (ss[i] == 1) {
      if (zeroCt + twoCt > ans) {
        ans = zeroCt + twoCt;
        ansL = twoStart + 1, ansR = i;
      }
      twoStart = i;
      twoCt = 0;
    }
  }
  cout << ans << endl;
  cout << (ansL + minPos - 1 + n) % n + 1 << " "
       << (ansR + minPos - 1 + n) % n + 1 << endl;
}
int main() {
  init();
  work();
  return 0;
}
