#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1e9 + 7;
int nxt[300100], par[300100], cnt[300100];
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> S;
  int T = 0;
  int start = -1;
  for (int i = 0; i < n;) {
    int len = 0;
    for (int j = i; j < n + i; ++j) {
      if (s[j % n] == '(')
        ++len;
      else
        --len;
      if (len < 0) {
        i = j + 1;
        break;
      }
    }
    if (len == 0) {
      start = i;
      break;
    } else if (len > 0)
      break;
  }
  if (start < 0) {
    cout << "0\n1 1" << endl;
    return 0;
  }
  for (int k = start; k < n + start; ++k) {
    int i = k % n;
    if (s[i] == '(') {
      if (!S.empty()) {
        par[i] = S.back();
      } else
        par[i] = i;
      S.push_back(i);
    } else {
      nxt[S.back()] = i;
      S.pop_back();
      if (S.empty()) {
        ++T;
      } else {
        cnt[S.back()]++;
      }
    }
  }
  int curmax = T;
  int pos = -1;
  for (int k = start; k < n + start; ++k) {
    int i = k % n;
    int cur = 0;
    if (s[i] == ')') continue;
    if (par[i] == i) {
      cur = cnt[i] + 1;
    } else if (par[par[i]] == par[i]) {
      cur = T + cnt[i] + 1;
    }
    if (cur > curmax) {
      curmax = cur;
      pos = i;
    }
  }
  cout << curmax << endl;
  if (pos == -1) {
    cout << "1 1" << endl;
  } else {
    cout << (pos + 1) << " " << (nxt[pos] + 1) << endl;
  }
  return 0;
}
