#include <bits/stdc++.h>
using namespace std;
int n, l[300010], r[300010], fa[300010], cnt[300010], stk[300010], tot, top;
char s[600010];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> s + 1;
  int pos = 0, mn = 0, cur = 0;
  for (int i = 1; i <= n; i++) {
    cur += (s[i] == '(' ? 1 : -1);
    if (mn > cur) mn = cur, pos = i;
  }
  if (cur != 0) {
    cout << 0 << endl << 1 << ' ' << 1 << endl;
    return 0;
  }
  for (int i = n + 1; i <= n * 2; i++) s[i] = s[i - n];
  for (int i = pos + 1; i <= pos + n; i++)
    if (s[i] == '(') {
      stk[++top] = ++tot;
      l[tot] = i;
    } else {
      r[stk[top]] = i;
      fa[stk[top]] = stk[top - 1];
      cnt[stk[--top]]++;
    }
  int ans = cnt[0], L = 1, R = 1;
  for (int i = 1; i <= tot; i++)
    if (!fa[i] && cnt[i] + 1 > ans) {
      ans = cnt[i] + 1;
      L = l[i], R = r[i];
    } else if (fa[i] && !fa[fa[i]] && cnt[0] + cnt[i] + 1 > ans) {
      ans = cnt[0] + cnt[i] + 1;
      L = l[i], R = r[i];
    } else
      continue;
  cout << ans << endl << (L - 1) % n + 1 << ' ' << (R - 1) % n + 1 << endl;
  return 0;
}
