#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[3000005];
long long dp[3000005];
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    char x;
    cin >> x;
    x == '(' ? a[i] = 1 : a[i] = -1;
  }
  for (long long i = n; i < n + n; i++) {
    a[i] = a[i - n];
  }
  long long minm = 0;
  long long ans1 = 0;
  long long ans2 = 0;
  long long ans = 0;
  pair<long long, long long> pp = {0, 0};
  for (long long i = 0; i < n; i++) {
    if (i) dp[i] = dp[i - 1];
    dp[i] += a[i];
    minm = min(minm, dp[i]);
  }
  if (dp[n - 1] != 0) {
    cout << "0\n1 1\n";
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    if (dp[i] == minm) ans1++;
  }
  long long cur = 0;
  long long j = -1;
  long long ex = 0;
  ans = ans1;
  for (long long i = 0; i < n + n; i++) {
    cur += a[i];
    if (cur <= minm + 1) {
      j = (i % n);
      ex = 0;
    } else {
      if (cur == minm + 2) ex++;
    }
    if (ex + ans1 >= ans) {
      ans = ex + ans1;
      pp.first = (j + 1) % n;
      pp.second = (i + 1) % n;
    }
  }
  cur = 0;
  j = -1;
  ex = 0;
  for (long long i = 0; i < n + n; i++) {
    cur += a[i];
    if (cur <= minm) {
      j = (i % n);
      ex = 0;
    } else {
      if (cur == minm + 1) ex++;
    }
    if (ex >= ans) {
      ans = ex;
      pp.first = (j + 1) % n;
      pp.second = (i + 1) % n;
    }
  }
  cout << ans << endl;
  cout << pp.first + 1 << " " << pp.second + 1 << endl;
  return 0;
}
