#include <bits/stdc++.h>
using namespace std;
const int maxd = 3e5 + 10;
char s[maxd], tmp[maxd];
int pre[maxd];
int cnt;
vector<int> a;
int main() {
  int n;
  scanf("%d %s", &n, s + 1);
  int now = 0, pos = 0, mi = 0;
  for (int i = 1; s[i]; i++) {
    now += ((s[i] == '(') ? 1 : -1);
    if (now < mi) mi = now, pos = i;
  }
  if (now) {
    printf("0\n1 1");
    return 0;
  }
  for (int i = 1; i <= n; i++) tmp[i] = s[(pos + i - 1) % n + 1];
  a.push_back(0);
  for (int i = 1; i <= n; i++) {
    s[i] = tmp[i];
    pre[i] = pre[i - 1] + ((s[i] == '(') ? 1 : -1);
    if (!pre[i]) cnt++, a.push_back(i);
  }
  int ans = cnt, ls = 1, rs = 1, len = a.size();
  for (int i = 1; i < len; i++) {
    int l = a[i - 1] + 1, r = a[i], t = 0;
    for (int j = l; j <= r; j++) t += (pre[j] == 1);
    if (t > ans) ans = t, ls = l, rs = r;
  }
  a.clear();
  for (int i = 1; i <= n; i++)
    if (pre[i] == 1) a.push_back(i);
  len = a.size();
  for (int i = 1; i < len; i++) {
    int l = a[i - 1] + 1, r = a[i], t = cnt;
    if (pre[l] == 0) continue;
    for (int j = l; j <= r; j++) t += (pre[j] == 2);
    if (t > ans) ans = t, ls = l, rs = r;
  }
  printf("%d\n%d %d", ans, (ls + pos - 1) % n + 1, (rs + pos - 1) % n + 1);
  return 0;
}
