#include <bits/stdc++.h>
using namespace std;
const int maxn = 6e5 + 5;
const int inf = 2e9 + 5;
int a[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; ++i) {
    a[i + 1] = a[i];
    if (s[i] == '(')
      ++a[i + 1];
    else
      --a[i + 1];
    a[i + n + 1] = a[i + 1];
  }
  if (a[n] != 0) return cout << 0 << '\n' << 1 << ' ' << 1 << '\n', 0;
  int mi = inf, p = 0;
  for (int i = 1; i <= n << 1; ++i)
    if (a[i] < mi) mi = a[i], p = i;
  for (int i = 1; i <= n << 1; ++i) a[i] -= mi;
  int ans = 0;
  for (int i = p; i < p + n; ++i)
    if (!a[i]) ++ans;
  int cnt = ans;
  int num1 = 0, num2 = 0;
  int l = p + 1, r = p + 1, last2 = p + 1, last1 = p + 1;
  for (int i = p + 1; i <= p + n; ++i) {
    if (a[i] == 2) ++num2;
    if (a[i] == 1) {
      if (ans < num2 + cnt) {
        ans = num2 + cnt;
        l = last2, r = i;
      }
      last2 = i + 1;
      num2 = 0;
      ++num1;
    }
    if (a[i] == 0) {
      if (ans < num1) {
        ans = num1;
        l = last1, r = i;
      }
      num1 = 0;
      last1 = i + 1;
    }
  }
  if (l > n) l -= n;
  if (r > n) r -= n;
  if (l > r) swap(l, r);
  cout << ans << '\n';
  cout << l << ' ' << r << '\n';
  return 0;
}
