#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
int n;
string s;
int a[maxn], ps[maxn];
int32_t main() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    int p = i + 1;
    if (s[i] == '(') {
      a[p] = a[p + n] = 1;
    } else {
      a[p] = a[p + n] = -1;
    }
  }
  for (int i = 1; i <= 2 * n; i++) ps[i] = ps[i - 1] + a[i];
  if (ps[n]) {
    cout << "0" << endl;
    cout << "1 1" << endl;
    return 0;
  }
  int beg = min_element(ps + 1, ps + 1 + n) - ps;
  int minv = ps[beg];
  for (int i = 1; i <= 2 * n; i++) ps[i] -= minv;
  int cl = -1, cc = 0;
  int mx = 0, ansl = 1, ansr = 1;
  int cl2 = 0, cc2 = 0;
  int mx2 = 0, ans2l = 1, ans2r = 1;
  for (int i = 1; i <= n; i++) {
    if (ps[i + beg] == 1) {
      if (cc > mx) {
        mx = cc;
        ansl = cl, ansr = i;
      }
      cl = i + 1;
      cc = 0;
    } else if (ps[i + beg] == 2)
      ++cc;
    if (ps[i + beg] == 0) {
      if (cc2 > mx2) {
        mx2 = cc2;
        ans2l = cl2 + 1, ans2r = i;
      }
      cl2 = i;
      cc2 = 0;
    } else if (ps[i + beg] == 1)
      ++cc2;
  }
  for (int i = 1; i <= n; i++) {
    if (ps[i + beg] == 0) ++mx;
  }
  if (mx2 > mx) {
    mx = mx2;
    ansl = ans2l;
    ansr = ans2r;
  }
  cout << mx << '\n';
  cout << (ansl + beg - 1 + n) % n + 1 << " " << (ansr + beg - 1 + n) % n + 1
       << '\n';
}
