#include <bits/stdc++.h>
using namespace std;
int n, o;
string s;
bool rot() {
  int h = 0;
  int loh = 0;
  for (int i = 0; i < n; i++) {
    if (h < loh) loh = h, o = i;
    h += (s[i] == '(' ? 1 : -1);
  }
  rotate(begin(s), begin(s) + o, end(s));
  return h;
}
void ans(int t, int l, int r) {
  cout << t << '\n';
  l = (l + o) % n;
  if (!l) l = n;
  r = (r + o) % n;
  if (!r) r = n;
  cout << l << ' ' << r << '\n';
  exit(0);
}
int main() {
  cin >> n >> s;
  if (rot()) ans(0, 0, 0);
  vector<int> h(n + 1);
  for (int i = 0; i < n; i++) h[i + 1] = h[i] + (s[i] == '(' ? 1 : -1);
  int c0 = -1, c1 = 0, c2 = 0;
  int mc1 = 0, mc2 = 0;
  int l1, ml1 = 1, mr1 = 1, l2, ml2 = 1, mr2 = 1;
  for (int i = 0; i < n + 1; i++) {
    if (h[i] == 0) {
      if (c1 > mc1) {
        mc1 = c1;
        ml1 = l1;
        mr1 = i;
      }
      c0++;
      c1 = 0;
      l1 = i + 1;
    }
    if (h[i] == 1) {
      if (c2 > mc2) {
        mc2 = c2;
        ml2 = l2;
        mr2 = i;
      }
      c1++;
      c2 = 0;
      l2 = i + 1;
    }
    if (h[i] == 2) {
      c2++;
    }
  }
  if (mc1 >= c0 + mc2) ans(mc1, ml1, mr1);
  ans(c0 + mc2, ml2, mr2);
}
