#include <bits/stdc++.h>
using namespace std;
int n, m;
inline int incr(int& i) { return i = (i < n - 1) ? i + 1 : 0; }
inline int next(int i) { return (i < m - 1) ? i + 1 : 0; }
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  string s;
  cin >> s;
  int w = 0, wmin = 0;
  vector<int> a;
  a.reserve(n);
  for (auto c : s) {
    if (c == '(')
      ++w;
    else if (c == ')')
      --w;
    a.push_back(w);
    wmin = min(wmin, w);
  }
  if (w != 0) {
    cout << "0\n1 1";
    return 0;
  }
  vector<int> x;
  x.reserve(n);
  for (int i = 0; i != n; ++i)
    if (a[i] == wmin) x.push_back(i);
  m = x.size();
  int maxx = x.size(), lmax = 1, rmax = 1;
  vector<vector<pair<int, int>>> y(x.size());
  for (int i = 0; i != x.size(); ++i) {
    vector<pair<int, int>> y;
    int j = x[i], r = x[next(i)];
    incr(j);
    while (j != r) {
      if (a[j] == wmin + 1)
        y.push_back({j, 0});
      else if (a[j] == wmin + 2)
        ++y.back().second;
      incr(j);
    }
    if (y.size() > maxx) {
      maxx = y.size();
      lmax = (x[i] + 1) % n;
      rmax = x[next(i)];
    }
    for (int j = 0; j != y.size(); ++j)
      if (y[j].second + x.size() > maxx) {
        maxx = y[j].second + x.size();
        lmax = (y[j].first + 1) % n;
        rmax = y[j + 1].first;
      }
  }
  cout << maxx << '\n' << lmax + 1 << ' ' << rmax + 1;
  return 0;
}
