#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0, min = 0, idx = -1;
  for (int i = 0; i < n; i++) {
    cnt += (s[i] == '(' ? 1 : -1);
    if (cnt < min) {
      min = cnt;
      idx = i;
    }
  }
  if (cnt) {
    cout << 0 << endl << 1 << " " << 1 << endl;
    return 0;
  }
  rotate(s.begin(), s.begin() + idx + 1, s.end());
  int z = 0, ans = 0, l = 0, r = 0;
  cnt = 0;
  vector<int> X;
  X.push_back(0);
  for (int i = 0; i < n; i++) {
    cnt += (s[i] == '(' ? 1 : -1);
    if (cnt == 0) {
      z++;
      X.push_back(i + 1);
    }
  }
  ans = z;
  for (int i = 0; i < X.size() - 1; i++) {
    cnt = 0;
    vector<int> Y;
    for (int j = X[i]; j < X[i + 1]; j++) {
      cnt += (s[j] == '(' ? 1 : -1);
      if (cnt == 1) Y.push_back(j + 1);
    }
    if (Y.size() > ans) {
      ans = Y.size(), l = X[i], r = X[i + 1] - 1;
    }
    for (int j = 0; j < Y.size() - 1; j++) {
      cnt = 0;
      int p = 0;
      for (int k = Y[j]; k < Y[j + 1]; k++) {
        cnt += (s[k] == '(' ? 1 : -1);
        if (cnt == 1) p++;
      }
      if (z + p > ans) {
        ans = z + p, l = Y[j], r = Y[j + 1] - 1;
      }
    }
  }
  cout << ans << endl
       << (l + idx + 1) % n + 1 << " " << (r + idx + 1) % n + 1 << endl;
  return 0;
}
