#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> pref(n + 1);
  for (int i = 0; i < n; i++) {
    pref[i + 1] = pref[i] + (s[i] == '(' ? 1 : -1);
  }
  if (pref[n] != 0) {
    cout << "0\n1 1\n";
    return 0;
  }
  int mm = INF;
  for (int i = 0; i < n; i++) {
    mm = min(mm, pref[i]);
  }
  pref.insert(pref.end(), pref.begin() + 1, pref.end());
  int start = 0;
  for (int i = 0; i < n; i++) {
    if (pref[i] == mm) {
      start = i;
      break;
    }
  }
  int net = 0, mx = 0;
  pair<int, int> ans = {-1, -1};
  for (int i = start, j = start; i < start + n; i = j) {
    j++;
    int cur = 0;
    for (; j <= start + n && pref[j] != mm; j++) {
      if (pref[j] == mm + 1) cur++;
    }
    if (cur > mx) {
      mx = cur;
      ans = {i % n, (j - 1 + n) % n};
    }
    net++;
  }
  for (int i = start, j = start; i < start + n; i = j) {
    j++;
    int cur = 0;
    for (; j <= start + n && pref[j] > mm + 1; j++) {
      if (pref[j] == mm + 2) cur++;
    }
    if (cur == 0) continue;
    if (cur + net > mx) {
      mx = cur + net;
      ans = {i % n, (j - 1 + n) % n};
    }
  }
  if (net >= mx) {
    cout << net << endl;
    cout << "1 1" << endl;
  } else {
    cout << mx << endl;
    cout << ans.first + 1 << " " << ans.second + 1 << endl;
  }
  return 0;
}
