#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 3, inf = 1e18, mod = 1e9 + 7, eps = -1e8;
long long tc, n, m, a, b, c, d, i, j, k, l, id, id2, id3, ans, cnt1, cnt2, mx,
    mx2;
long long flag[N];
string s, t;
stack<long long> st;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> s;
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '(')
      cnt1++;
    else
      cnt2++;
    if (cnt1 - cnt2 > mx) mx = cnt1 - cnt2, id = i;
  }
  if (cnt1 != cnt2) cout << 0 << endl << 1 << ' ' << 1 << endl, exit(0);
  t.push_back(s[id]);
  for (i = (id + 1) % n; i != id; i = (i + 1) % n) t.push_back(s[i]);
  s = t;
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      st.push(i);
    else
      flag[st.top()] = i, st.pop();
  }
  for (i = 0, mx = -1, mx2 = -1, cnt1 = 0; i != n; i = flag[i] + 1, cnt1++) {
    for (j = i + 1, cnt2 = 0; j != flag[i]; j = flag[j] + 1, cnt2++) {
      for (k = j + 1, l = 0; k != flag[j]; k = flag[k] + 1, l++)
        ;
      if (mx2 < l) mx2 = l, id3 = j;
    }
    if (mx < cnt2) mx = cnt2, id2 = i;
  }
  if (mx < mx2 + cnt1) mx = mx2 + cnt1, id2 = id3;
  if (mx < cnt1)
    cout << cnt1 << endl << 1 << ' ' << 1 << endl;
  else
    cout << mx + 1 << endl
         << (id2 + id) % n + 1 << ' ' << (id + flag[id2]) % n + 1 << endl;
}
