#include <bits/stdc++.h>
using namespace std;
void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 1e6;
const long long inf = 1e9 + 7;
const long double PI = acos(-1);
long long bin_pow(long long x, long long y) {
  long long res = 1, base = x;
  while (y) {
    if (y & 1) {
      res *= base;
      res %= inf;
    }
    base *= base;
    base %= inf;
    y /= 2;
  }
  return res;
}
int n, mn = inf;
char s[N];
int cur[N], d[N];
int le[N], st[N], top;
int sum[N], ans;
int main() {
  boost();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    s[i + n] = s[i];
  }
  int cnt = 0, pos = 1;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(') {
      cnt++;
    } else {
      cnt--;
    }
    if (cnt < mn) {
      mn = cnt;
      pos = i + 1;
    }
  }
  if (cnt) {
    cout << "0\n1 1";
    return 0;
  }
  for (int i = pos; i <= pos + n - 1; i++) {
    if (s[i] == '(') {
      top++;
      st[top] = i;
    } else {
      sum[i] = cur[top];
      cur[top] = 0;
      le[i] = st[top];
      top--;
      d[i] = top;
      cur[top]++;
    }
    if (top == 0) {
      ans++;
    }
  }
  int curans = ans;
  int l, r;
  l = r = 1;
  for (int i = pos + 1; i <= pos + n - 1; i++) {
    if (s[i] == ')') {
      if (d[i] == 0 && sum[i] + 1 > ans) {
        ans = sum[i] + 1;
        l = le[i];
        r = i;
      }
      if (d[i] == 1 && sum[i] + curans + 1 > ans) {
        ans = sum[i] + curans + 1;
        l = le[i];
        r = i;
      }
    }
  }
  cout << ans << "\n" << (l - 1) % n + 1 << " " << (r - 1) % n + 1;
}
