#include <bits/stdc++.h>
using namespace std;
const int len = 6e5 + 10;
const int mod = 1e9 + 7;
stack<int> st;
int sum[len];
int main() {
  string str;
  int n;
  cin >> n >> str;
  str += str;
  if (str[0] == '(')
    sum[0] = 1;
  else
    sum[0] = -1;
  for (int i = 1; i < n; ++i)
    if (str[i] == '(')
      sum[i] = sum[i - 1] + 1;
    else
      sum[i] = sum[i - 1] - 1;
  if (sum[n - 1] != 0)
    puts("0\n1 1");
  else {
    int l = 0, r = 0;
    for (int i = 0; i < n * 2; ++i) {
      if (st.empty() || str[i] == '(')
        st.push(i);
      else {
        if (str[st.top()] == '(')
          st.pop();
        else
          st.push(i);
      }
      if (i >= n - 1 && (st.empty() || st.size() && i - n == st.top())) {
        l = i - n + 1;
        r = i;
        break;
      }
    }
    int ans = 0, ans1 = 0, ans2 = 0, num = 0, all;
    memset(sum, 0, sizeof(sum));
    if (l == 0) l = n, r = 2 * n - 1;
    for (int i = l; i <= r; ++i) {
      if (str[i] == '(')
        sum[i] = sum[i - 1] + 1;
      else
        sum[i] = sum[i - 1] - 1;
      if (!sum[i]) num++;
    }
    ans = num;
    all = num;
    for (int i = l; i <= r; ++i) {
      num = 1;
      int left = i;
      if (sum[i] == 1 && str[i] == '(') {
        while (sum[i + 1] != 0) {
          if (sum[i + 1] == 2 && sum[i + 2] == 1) num++;
          i += 2;
        }
        if (num > ans) {
          ans = num;
          ans1 = left;
          ans2 = i + 1;
        }
      }
    }
    for (int i = l; i <= r; ++i) {
      num = 2;
      int left = i;
      if (sum[i] == 2 && str[i] == '(') {
        while (sum[i + 1] != 1) {
          if (sum[i + 1] == 3 && sum[i + 2] == 2) num++;
          i += 2;
        }
        if (num + all - 1 > ans) {
          ans = num + all - 1;
          ans1 = left;
          ans2 = i + 1;
        }
      }
    }
    cout << ans << endl;
    cout << ans1 % n + 1 << ' ' << ans2 % n + 1 << endl;
  }
}
