#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cont = 0;
  for (int i = int(0); i < int(n); ++i)
    if (s[i] == '(')
      cont++;
    else
      cont--;
  if (cont) {
    cout << "0" << endl;
    cout << "1 1" << endl;
  } else {
    s = s + s;
    stack<char> St;
    int cont = 0;
    int pos = 0;
    for (int i = int(0); i < int(2 * n); ++i) {
      if (s[i] == ')' && St.empty()) {
        pos = i + 1;
        cont = 0;
        continue;
      }
      if (s[i] == '(')
        St.push(s[i]);
      else
        St.pop();
      cont++;
      if (cont == n) break;
    }
    s = s.substr(pos, n);
    int ans = 0;
    int l = 1, r = 1;
    vector<pair<pair<int, int>, int> > cur;
    int acum = 0;
    int tot = 0;
    for (int i = int(0); i < int(n); ++i) {
      if (s[i] == '(')
        acum++;
      else
        acum--;
      if (!acum) tot++;
    }
    ans = tot;
    int curl, curl2;
    bool chi = 0, chi2 = 0;
    int acum2 = 0;
    for (int i = int(0); i < int(n); ++i) {
      if (s[i] == '(')
        acum++;
      else
        acum--;
      if (acum == 1 && !chi) {
        curl = i;
        chi = 1;
      } else if (acum == 1) {
        chi2 = 0;
        cur.push_back(make_pair(make_pair(curl2, i), acum2));
        acum2 = 0;
      } else {
        if (acum == 2 && !chi2) {
          chi2 = 1;
          curl2 = i;
        } else if (acum == 2)
          acum2++;
      }
      if (!acum) {
        chi = 0;
        if ((int((cur).size()) + 1) > ans) {
          ans = int((cur).size()) + 1;
          l = curl;
          r = i;
        }
        for (int j = int(0); j < int(int((cur).size())); ++j)
          if ((tot + 1 + cur[j].second) > ans) {
            ans = tot + 1 + cur[j].second;
            l = cur[j].first.first;
            r = cur[j].first.second;
          }
        cur.clear();
      }
    }
    cout << ans << endl;
    cout << (l + pos) % n + 1 << " " << (r + pos) % n + 1 << endl;
  }
  return 0;
}
