#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long double PI = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, open = 0, close = 0;
  string s;
  cin >> n >> s;
  vector<long long> idx(n);
  for (long long i = 0; i < n; i++) {
    if (s[i] == '(')
      open++;
    else
      close++;
  }
  if (open != close) {
    cout << 0 << '\n';
    cout << 1 << " " << 1 << '\n';
    return 0;
  }
  stack<pair<long long, long long>> isValid;
  for (long long i = 0; i < n; i++) {
    if (s[i] == ')') {
      if ((isValid.size() > 0) && (isValid.top().first == -1)) {
        isValid.pop();
      } else {
        isValid.push({1, i});
      }
    } else
      isValid.push({-1, i});
  }
  long long sz = isValid.size();
  sz /= 2;
  while (sz--) {
    isValid.pop();
  }
  long long shift = 0;
  vector<long long> seq, lvl(n, 10), ending(n, -1), lowerCount(n, 0);
  vector<long long> count(3, 0);
  if (isValid.size()) shift = isValid.top().second + 1;
  for (long long i = shift; i < shift + n; i++) {
    if (s[i % n] == '(')
      seq.push_back(1);
    else
      seq.push_back(-1);
    idx[i - shift] = (i % n) + 1;
  }
  long long depth = -1;
  stack<pair<long long, long long>> compute;
  for (long long i = 0; i < n; i++) {
    if (seq[i] == 1) {
      depth++;
      if (depth < 3) count[depth]++;
      lvl[i] = depth;
      compute.push({1, i});
    } else {
      if (depth < 2) lowerCount[compute.top().second] = count[depth + 1];
      if (depth < 3) {
        for (long long j = depth + 1; j < 3; j++) count[j] = 0;
      }
      depth--;
      ending[compute.top().second] = i;
      compute.pop();
    }
  }
  long long ans = count[0];
  long long l = 1, r = 1;
  for (long long i = 0; i < n; i++) {
    if ((lvl[i] <= 1) && (seq[i] == 1)) {
      if (lvl[i] == 0) {
        long long val = lowerCount[i] + 1;
        if (ans < val) {
          ans = val;
          l = idx[i];
          r = idx[ending[i]];
        }
      }
      if (lvl[i] == 1) {
        long long val = lowerCount[i] + 1 + count[0];
        if (ans < val) {
          ans = val;
          l = idx[i];
          r = idx[ending[i]];
        }
      }
    }
  }
  cout << ans << '\n';
  cout << l << " " << r << '\n';
  return 0;
}
